aboutsummaryrefslogtreecommitdiff
path: root/nerv/matrix/init.lua
diff options
context:
space:
mode:
authortxh18 <cloudygooseg@gmail.com>2015-11-17 21:58:05 +0800
committertxh18 <cloudygooseg@gmail.com>2015-11-17 21:58:05 +0800
commitfc4c5a71053b837ed6143659a6e7b45792ed9e51 (patch)
treea5d3fbf7c59dfb08f67b2156d70def64f98925ad /nerv/matrix/init.lua
parentb8b6bb0a6b9fb9b8d72de42d27f598bfddd1cd0e (diff)
added atomicAdd for select_linear update, however, the result still seems unreproducable, I changed select_linear layer update back to line-by-line
Diffstat (limited to 'nerv/matrix/init.lua')
-rw-r--r--nerv/matrix/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/nerv/matrix/init.lua b/nerv/matrix/init.lua
index 1091d7e..14b83d4 100644
--- a/nerv/matrix/init.lua
+++ b/nerv/matrix/init.lua
@@ -80,3 +80,15 @@ function nerv.CuMatrixFloat:new_to_host()
self:copy_toh(res)
return res
end
+
+function nerv.CuMatrixDouble.new_from_host(mat)
+ local res = nerv.CuMatrixDouble(mat:nrow(), mat:ncol())
+ res:copy_fromh(mat)
+ return res
+end
+
+function nerv.CuMatrixDouble:new_to_host()
+ local res = nerv.MMatrixDouble(self:nrow(), self:ncol())
+ self:copy_toh(res)
+ return res
+end