diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-06-26 14:41:18 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-06-26 14:41:18 +0200 |
commit | df7789cbef7ffa9658c61525edf75bebaa6398ff (patch) | |
tree | 8b004a208910a9c38f20ec312fbb0e74a5a2c279 /modules/remote-sycl/c++/device.hpp | |
parent | eda37df9c399b23dc5bdb668730101a87f4770ce (diff) |
Got double free :/
Diffstat (limited to 'modules/remote-sycl/c++/device.hpp')
-rw-r--r-- | modules/remote-sycl/c++/device.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/remote-sycl/c++/device.hpp b/modules/remote-sycl/c++/device.hpp index 46644b4..5e63a1d 100644 --- a/modules/remote-sycl/c++/device.hpp +++ b/modules/remote-sycl/c++/device.hpp @@ -28,8 +28,14 @@ public: * Copy data to host */ template<typename Schema, typename Encoding, typename Storage> - error_or<data<Schema, Encoding, Storage>> copy_to_host(const data<Schema, Encoding, rmt::Sycl>& dev_data){ - return {}; + error_or<data<Schema, Encoding, Storage>> copy_to_host(data<Schema, Encoding, rmt::Sycl>& dev_data){ + data<Schema,Encoding, Storage> host_data; + cmd_queue_.submit([&](cl::sycl::handler& h){ + auto acc_buff = dev_data.template access<cl::sycl::access::mode::read>(h); + h.copy(acc_buff, &host_data); + }); + cmd_queue_.wait(); + return host_data; } /** |