From 51fd65c247ff6d603c1fe27d697e46288ac73022 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 30 Oct 2025 10:53:14 +0100 Subject: Reworking Sycl. Semi broken state --- modules/remote-sycl/benchmarks/mixed_precision.cpp | 68 ++++++++++------------ 1 file changed, 31 insertions(+), 37 deletions(-) (limited to 'modules/remote-sycl/benchmarks/mixed_precision.cpp') diff --git a/modules/remote-sycl/benchmarks/mixed_precision.cpp b/modules/remote-sycl/benchmarks/mixed_precision.cpp index d4b119b..aabe949 100644 --- a/modules/remote-sycl/benchmarks/mixed_precision.cpp +++ b/modules/remote-sycl/benchmarks/mixed_precision.cpp @@ -82,20 +82,20 @@ int main(int argc, char** argv){ if(!rmt_addr){ return -1; } - - cl::sycl::event mixed_ev; - cl::sycl::event float32_ev; - cl::sycl::event float64_ev; + // acpp::sycl::queue cmd_queue; + acpp::sycl::event mixed_ev; + acpp::sycl::event float32_ev; + acpp::sycl::event float64_ev; auto sycl_iface = listen_mixed_precision(mixed_ev, float64_ev, float32_ev, arithmetic_intensity); - data mixed_host_data; - data float64_host_data; - data float32_host_data; + data> mixed_data; + data> float64_data; + data> float32_data; - auto time_eval = [](uint64_t & current_min_time, cl::sycl::event& ev){ - auto end = ev.get_profiling_info(); - auto start = ev.get_profiling_info(); + auto time_eval = [](uint64_t & current_min_time, acpp::sycl::event& ev){ + auto end = ev.get_profiling_info(); + auto start = ev.get_profiling_info(); uint64_t curr_time = (end-start); current_min_time = std::min(curr_time, current_min_time); @@ -110,22 +110,19 @@ int main(int argc, char** argv){ std::cout<<"Warming up ..."<(gen_num); - float64_host_data.at(i) = static_cast(gen_num); - float32_host_data.at(i) = static_cast(gen_num); + mixed_data.at({{i}}) = {static_cast(gen_num)}; + float64_data.at({{i}}) = {static_cast(gen_num)}; + float32_data.at({{i}}) = {static_cast(gen_num)}; } - data> mixed_device_data{mixed_host_data}; - data> float64_device_data{float64_host_data}; - data> float32_device_data{float32_host_data}; - sycl_iface.template call<"float64_32">(mixed_device_data, &(device.get_handle())); - sycl_iface.template call<"float64">(float64_device_data, &(device.get_handle())); - sycl_iface.template call<"float32">(float32_device_data, &(device.get_handle())); + sycl_iface.template call<"float64_32">(mixed_data, &(device.get_handle())); + sycl_iface.template call<"float64">(float64_data, &(device.get_handle())); + sycl_iface.template call<"float32">(float32_data, &(device.get_handle())); device.get_handle().wait(); } @@ -142,32 +139,29 @@ int main(int argc, char** argv){ (std::cout<<'.').flush(); - data mixed_host_data; - data float64_host_data; - data float32_host_data; + data> mixed_data; + data> float64_data; + data> float32_data; - mixed_host_data = {test_size}; - float64_host_data = {test_size}; - float32_host_data = {test_size}; + mixed_data = {{{test_size}}}; + float64_data = {{{test_size}}}; + float32_data = {{{test_size}}}; for(uint64_t i = 0; i < test_size; ++i){ double gen_num = dis(e1); - mixed_host_data.at(i) = static_cast(gen_num); - float64_host_data.at(i) = static_cast(gen_num); - float32_host_data.at(i) = static_cast(gen_num); + mixed_data.at({{i}}) = {static_cast(gen_num)}; + float64_data.at({{i}}) = {static_cast(gen_num)}; + float32_data.at({{i}}) = {static_cast(gen_num)}; } - data> mixed_device_data{mixed_host_data}; - data> float64_device_data{float64_host_data}; - data> float32_device_data{float32_host_data}; - sycl_iface.template call<"float64_32">(mixed_device_data, &(device.get_handle())); + sycl_iface.template call<"float64_32">(mixed_data, &(device.get_handle())); device.get_handle().wait(); time_eval(time_mixed, mixed_ev); - sycl_iface.template call<"float64">(float64_device_data, &(device.get_handle())); + sycl_iface.template call<"float64">(float64_data, &(device.get_handle())); device.get_handle().wait(); time_eval(time_float64, float64_ev); - sycl_iface.template call<"float32">(float32_device_data, &(device.get_handle())); + sycl_iface.template call<"float32">(float32_data, &(device.get_handle())); device.get_handle().wait(); time_eval(time_float32, float32_ev); } -- cgit v1.2.3