You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2017/12/08 19:22:31 UTC
[incubator-mxnet] branch master updated: Implement assignment
operator on Timing 'info' struct (#8996)
This is an automated email from the ASF dual-hosted git repository.
jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new c94b104 Implement assignment operator on Timing 'info' struct (#8996)
c94b104 is described below
commit c94b104ea2c212b5757d8fb5fc4c27ed086e2713
Author: Chris Olivier <cj...@gmail.com>
AuthorDate: Fri Dec 8 11:22:25 2017 -0800
Implement assignment operator on Timing 'info' struct (#8996)
---
tests/cpp/include/test_core_op.h | 4 ++--
tests/cpp/include/test_op.h | 2 +-
tests/cpp/include/test_perf.h | 9 +++++++++
tests/cpp/include/test_tune.h | 4 ++--
tests/cpp/operator/tune/operator_tune_test.cc | 2 +-
5 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/tests/cpp/include/test_core_op.h b/tests/cpp/include/test_core_op.h
index 51cbcd7..6a220bd 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 bddade0..af83969 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 672b28a..597b87f 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 725aa90..9cf4a2e 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 7d3fa09..2a37d0c 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;
}
/*!
--
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].