diff options
author | txh18 <cloudygooseg@gmail.com> | 2015-11-17 21:58:05 +0800 |
---|---|---|
committer | txh18 <cloudygooseg@gmail.com> | 2015-11-17 21:58:05 +0800 |
commit | fc4c5a71053b837ed6143659a6e7b45792ed9e51 (patch) | |
tree | a5d3fbf7c59dfb08f67b2156d70def64f98925ad /nerv/matrix | |
parent | b8b6bb0a6b9fb9b8d72de42d27f598bfddd1cd0e (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')
-rw-r--r-- | nerv/matrix/init.lua | 12 |
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 |