SINGA-80 New Blob Level and Address Level Math Operation Interface ----
clean warnings in test_math_addr Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/21cfc215 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/21cfc215 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/21cfc215 Branch: refs/heads/master Commit: 21cfc2154022058710a50d1d29ff082130c6ca27 Parents: 38dc9a1 Author: jinyangturbo <[email protected]> Authored: Tue Nov 10 05:56:09 2015 -0800 Committer: jinyangturbo <[email protected]> Committed: Tue Nov 10 05:56:09 2015 -0800 ---------------------------------------------------------------------- include/singa/utils/math_addr.h | 4 ++-- src/test/test_math.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/21cfc215/include/singa/utils/math_addr.h ---------------------------------------------------------------------- diff --git a/include/singa/utils/math_addr.h b/include/singa/utils/math_addr.h index 4d34f6f..ad78df7 100644 --- a/include/singa/utils/math_addr.h +++ b/include/singa/utils/math_addr.h @@ -74,14 +74,14 @@ Dtype cpu_dot(const Dtype * A, const Dtype * B, const int n) { // element-wise template<typename Op, typename Dtype> -void cpu_e_f(const int n, Dtype * A, Dtype* B) { +void cpu_e_f(const int n, Dtype * A, Dtype * B) { for (int i = 0 ; i < n ; i++) { Op::Map(A[i], &B[i]); } } template<typename Op, typename Dtype> -void cpu_e_f(const int n, Dtype * A, Dtype* B, Dtype* C) { +void cpu_e_f(const int n, Dtype * A, Dtype * B, Dtype * C) { for (int i = 0 ; i < n ; i++) { Op::Map(A[i], B[i], &C[i]); } http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/21cfc215/src/test/test_math.cc ---------------------------------------------------------------------- diff --git a/src/test/test_math.cc b/src/test/test_math.cc index d2818f1..e64d567 100644 --- a/src/test/test_math.cc +++ b/src/test/test_math.cc @@ -89,7 +89,7 @@ TEST(MathTest, TestAxpyCPU) { cpu_axpy(A[0], 12, 2.0f, B[0]); for(int i = 0; i < 12; i++) { - D[0][i] += 2*C[0][i]; + D[i / 4][i % 4] += 2*C[i / 3][i % 3]; } for(int i = 0; i < 3; i++) @@ -101,6 +101,7 @@ TEST(MathTest, TestAxpyCPU) { } } +/* TEST(MathTest, TestEopCPU) { float A[10] = {}; @@ -115,7 +116,6 @@ TEST(MathTest, TestEopCPU) { C[i] = i; } -/* cpu_e_f<singa::op::Set>(5, 15.0f, O, O); for(int i = 0; i < 5; i++) { @@ -125,8 +125,8 @@ TEST(MathTest, TestEopCPU) { { ASSERT_EQ(O[i],0); } - */ } +*/ #ifdef USE_GPU TEST(MathTest, TestGemmGPU) {
