diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-06-26 14:43:38 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-06-26 14:43:38 +0200 |
commit | 7f230b02b106029351480f2f201b95235b516e5d (patch) | |
tree | 89adb52e71463fb27d76309a995a3550db16d74b /modules/remote-sycl | |
parent | df7789cbef7ffa9658c61525edf75bebaa6398ff (diff) |
Fixed the double free :)
Diffstat (limited to 'modules/remote-sycl')
-rw-r--r-- | modules/remote-sycl/c++/device.hpp | 5 | ||||
-rw-r--r-- | modules/remote-sycl/tests/sycl_basics.cpp | 9 |
2 files changed, 4 insertions, 10 deletions
diff --git a/modules/remote-sycl/c++/device.hpp b/modules/remote-sycl/c++/device.hpp index 5e63a1d..e6f3fe3 100644 --- a/modules/remote-sycl/c++/device.hpp +++ b/modules/remote-sycl/c++/device.hpp @@ -29,13 +29,16 @@ public: */ template<typename Schema, typename Encoding, typename Storage> 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; + */ + cl::sycl::host_accessor result{dev_data.get_handle()}; + return result[0]; } /** diff --git a/modules/remote-sycl/tests/sycl_basics.cpp b/modules/remote-sycl/tests/sycl_basics.cpp index bf41983..90da299 100644 --- a/modules/remote-sycl/tests/sycl_basics.cpp +++ b/modules/remote-sycl/tests/sycl_basics.cpp @@ -81,16 +81,7 @@ SAW_TEST("SYCL Test Setup"){ } }; - std::cout<<"Running on:\n"<<device.get_handle().get_device().get_info<cl::sycl::info::device::name>()<<std::endl; - - std::cout<<host_data.template get<"foo">().get()<<std::endl; - std::cout<<host_data.template get<"bar">().get()<<std::endl; - std::cout<<std::endl; cl_iface.template call <"foo">(device_data, &device.get_handle()); device.get_handle().wait(); - std::cout<<host_data.template get<"foo">().get()<<std::endl; - std::cout<<host_data.template get<"bar">().get()<<std::endl; - auto& dbls = host_data.template get<"doubles">(); - std::cout<<std::endl; } } |