summaryrefslogtreecommitdiff
path: root/modules/remote-hip/c++/device.tmpl.hpp
diff options
context:
space:
mode:
authorClaudius 'keldu' Holeksa <mail@keldu.de>2024-09-17 11:41:12 +0200
committerClaudius 'keldu' Holeksa <mail@keldu.de>2024-09-17 11:41:12 +0200
commita3ae458a06f43e9c3e0e346d178c91f46094f990 (patch)
tree8d36b6eb3d6cca94734264d825f19f583a0ffe74 /modules/remote-hip/c++/device.tmpl.hpp
parent1d578450dc82843bd4b24f3a6aad2c1a82bbda5e (diff)
wip
Diffstat (limited to 'modules/remote-hip/c++/device.tmpl.hpp')
-rw-r--r--modules/remote-hip/c++/device.tmpl.hpp11
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();
}