diff options
Diffstat (limited to 'modules/remote-hip/c++/device.tmpl.hpp')
-rw-r--r-- | modules/remote-hip/c++/device.tmpl.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/remote-hip/c++/device.tmpl.hpp b/modules/remote-hip/c++/device.tmpl.hpp index 0517f67..cf31336 100644 --- a/modules/remote-hip/c++/device.tmpl.hpp +++ b/modules/remote-hip/c++/device.tmpl.hpp @@ -41,9 +41,18 @@ struct hip_copy_to_device<schema::Array<T,Dim>, Encoding> { } // auto from_dat = &from.at(0); + data<Schema,Encoding> tmp_fake_dat; + { + auto eov = tmp_fake_dat.adopt(dat, from.size()); + if(eov.is_error()){ + return eov; + } + } hipError_t malloc_err = hipMalloc(to, sizeof(data<Schema,Encoding>)); - hipError_t copy_err = hipMemcpy(*to, &from, sizeof(data<Schema,Encoding>), hipMemcpyHostToDevice); + hipError_t copy_err = hipMemcpy(*to, &tmp_fake_dat, sizeof(data<Schema,Encoding>), hipMemcpyHostToDevice); + + tmp_fake_dat.extract(); return make_void(); } |