aboutsummaryrefslogtreecommitdiff
path: root/nerv/matrix/init.lua
diff options
context:
space:
mode:
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