You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by ka...@apache.org on 2015/11/16 07:09:00 UTC

[14/19] incubator-singa git commit: SINGA-80 New Blob Level and Address Level Math Operation Interface

SINGA-80 New Blob Level and Address Level Math Operation Interface

----

fix a bug in MVSum function name


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/38dc9a18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/38dc9a18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/38dc9a18

Branch: refs/heads/master
Commit: 38dc9a180ceadf3d3795b46e361985e8d6cb8182
Parents: d333cba
Author: jinyangturbo <pk...@gmail.com>
Authored: Tue Nov 10 05:33:31 2015 -0800
Committer: jinyangturbo <pk...@gmail.com>
Committed: Tue Nov 10 05:33:31 2015 -0800

----------------------------------------------------------------------
 include/singa/utils/math_blob.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/38dc9a18/include/singa/utils/math_blob.h
----------------------------------------------------------------------
diff --git a/include/singa/utils/math_blob.h b/include/singa/utils/math_blob.h
index 1aa4be0..bfdb5f3 100644
--- a/include/singa/utils/math_blob.h
+++ b/include/singa/utils/math_blob.h
@@ -436,6 +436,8 @@ void MVAddRow(XPU xpu, Dtype alpha, Dtype beta, const Blob<Dtype> & A,
 #ifdef USE_GPU
     if (xpu == gpu) {
       // gpu part
+      singa_gpu_add_vec_row(B->gpu_data(),
+          A.gpu_data(), A.gpu_data(), m, n, n);
     }
 #endif  // USE_GPU
   }
@@ -502,7 +504,7 @@ void MVSumCol(XPU xpu, Dtype alpha, Dtype beta, const Blob<Dtype> & A,
  * # rows of A = A.count() / B.count().
  */
 template<typename Dtype>
-void MVSumCol(XPU xpu, Dtype alpha, Dtype beta, const Blob<Dtype> & A,
+void MVSumRow(XPU xpu, Dtype alpha, Dtype beta, const Blob<Dtype> & A,
     Blob<Dtype> * B) {
   CHECK_EQ(A.count() % B->count(), 0) << "length of B must = # of cols of A";
   int m = B->count(), n = A.count() / m;
@@ -514,7 +516,7 @@ void MVSumCol(XPU xpu, Dtype alpha, Dtype beta, const Blob<Dtype> & A,
   }
 #ifdef USE_GPU
   if (xpu == gpu) {
-    singa_gpu_sum_col(A.gpu_data(), B->gpu_data(), m, n, n);
+    singa_gpu_sum_row(A.gpu_data(), B->gpu_data(), m, n, n);
     // gpu part (TODO check transpose case)
   }
 #endif  // USE_GPU