piiswrong closed pull request #8996: Implement assignment operator on Timing 'Info' struct URL: https://github.com/apache/incubator-mxnet/pull/8996
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/cpp/include/test_core_op.h b/tests/cpp/include/test_core_op.h index 51cbcd71a3..6a220bdad6 100644 --- a/tests/cpp/include/test_core_op.h +++ b/tests/cpp/include/test_core_op.h @@ -138,7 +138,7 @@ class CoreOpExecutor : public test::op::OperatorDataInitializer<DType> AccessAsCPU(array, ctx_.run_ctx, [this](const NDArray &arr) { test::op::OperatorDataInitializer<DType>::FillRandom(arr.data()); }); - return std::move(array); + return array; } /*! @@ -154,7 +154,7 @@ class CoreOpExecutor : public test::op::OperatorDataInitializer<DType> AccessAsCPU(array, ctx_.run_ctx, [this](const NDArray &arr) { test::op::OperatorDataInitializer<DType>::FillZero(arr.data()); }); - return std::move(array); + return array; } nnvm::NodePtr MakeNode() const { diff --git a/tests/cpp/include/test_op.h b/tests/cpp/include/test_op.h index bddade0830..af83969d1d 100644 --- a/tests/cpp/include/test_op.h +++ b/tests/cpp/include/test_op.h @@ -284,7 +284,7 @@ inline std::vector<TShape> ShapesOf(const std::vector<NDArray>& arrays) { for (const NDArray& ar : arrays) { res.emplace_back(ar.shape()); } - return std::move(res); + return res; } } // namespace op diff --git a/tests/cpp/include/test_perf.h b/tests/cpp/include/test_perf.h index 672b28a426..597b87fa75 100644 --- a/tests/cpp/include/test_perf.h +++ b/tests/cpp/include/test_perf.h @@ -278,6 +278,15 @@ class TimingInstrument { CHECK_EQ(o.nestingCount_, 0U); } + inline Info& operator = (const Info& o) { + name_ = o.name_; + baseTime_.store(baseTime_.load()); + nestingCount_.store(nestingCount_.load()); + cycleCount_.store(cycleCount_.load()); + duration_.store(duration_.load()); + return *this; + } + /*! * \brief Return time for each operation in milliseconds * \return Time for each operation in milliseconds diff --git a/tests/cpp/include/test_tune.h b/tests/cpp/include/test_tune.h index 725aa90a10..9cf4a2e08e 100644 --- a/tests/cpp/include/test_tune.h +++ b/tests/cpp/include/test_tune.h @@ -102,7 +102,7 @@ class TuningTester { CHECK(res.find(this_run_shapes) == res.end()); res[this_run_shapes] = tmap; } - return std::move(res); + return res; } using tuned_timing_t = std::map< @@ -237,7 +237,7 @@ class TuningTester { results[shapes] = result; } } - return std::move(results); + return results; } /*! diff --git a/tests/cpp/operator/tune/operator_tune_test.cc b/tests/cpp/operator/tune/operator_tune_test.cc index 7d3fa09a87..2a37d0c2cf 100644 --- a/tests/cpp/operator/tune/operator_tune_test.cc +++ b/tests/cpp/operator/tune/operator_tune_test.cc @@ -58,7 +58,7 @@ static std::vector<std::vector<TShape>> tuning_shapes() { {{50, 3, 18, 32}} }; } - return std::move(shapes); + return shapes; } /*! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services