summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/benchmarks
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-10-30 10:53:14 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-10-30 10:53:14 +0100
commit51fd65c247ff6d603c1fe27d697e46288ac73022 (patch)
tree20765fe69ecef52f3dfdebe8e46bcc58a85987f2 /modules/remote-sycl/benchmarks
parent733e2485878e22a5b585d41358e5ea680f3f7246 (diff)
downloadforstio-forstio-51fd65c247ff6d603c1fe27d697e46288ac73022.tar.gz
Reworking Sycl. Semi broken state
Diffstat (limited to 'modules/remote-sycl/benchmarks')
-rw-r--r--modules/remote-sycl/benchmarks/mixed_precision.cpp68
-rw-r--r--modules/remote-sycl/benchmarks/mixed_precision.hpp8
2 files changed, 35 insertions, 41 deletions
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<sch::MixedArray> mixed_host_data;
- data<sch::Float64Array> float64_host_data;
- data<sch::Float32Array> float32_host_data;
+ data<sch::MixedArray, encode::Sycl<encode::Native>> mixed_data;
+ data<sch::Float64Array, encode::Sycl<encode::Native>> float64_data;
+ data<sch::Float32Array, encode::Sycl<encode::Native>> float32_data;
- auto time_eval = [](uint64_t & current_min_time, cl::sycl::event& ev){
- auto end = ev.get_profiling_info<cl::sycl::info::event_profiling::command_end>();
- auto start = ev.get_profiling_info<cl::sycl::info::event_profiling::command_start>();
+ auto time_eval = [](uint64_t & current_min_time, acpp::sycl::event& ev){
+ auto end = ev.get_profiling_info<acpp::sycl::info::event_profiling::command_end>();
+ auto start = ev.get_profiling_info<acpp::sycl::info::event_profiling::command_start>();
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 ..."<<std::endl;
for(uint64_t test_size = 1ul; test_size < max_test_size; test_size *= 2ul){
- 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<double>(gen_num);
- float64_host_data.at(i) = static_cast<double>(gen_num);
- float32_host_data.at(i) = static_cast<float>(gen_num);
+ mixed_data.at({{i}}) = {static_cast<double>(gen_num)};
+ float64_data.at({{i}}) = {static_cast<double>(gen_num)};
+ float32_data.at({{i}}) = {static_cast<float>(gen_num)};
}
- data<sch::MixedArray, encode::Sycl<encode::Native>> mixed_device_data{mixed_host_data};
- data<sch::Float64Array, encode::Sycl<encode::Native>> float64_device_data{float64_host_data};
- data<sch::Float32Array, encode::Sycl<encode::Native>> 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<sch::MixedArray> mixed_host_data;
- data<sch::Float64Array> float64_host_data;
- data<sch::Float32Array> float32_host_data;
+ data<sch::MixedArray, encode::Sycl<encode::Native>> mixed_data;
+ data<sch::Float64Array, encode::Sycl<encode::Native>> float64_data;
+ data<sch::Float32Array, encode::Sycl<encode::Native>> 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<double>(gen_num);
- float64_host_data.at(i) = static_cast<double>(gen_num);
- float32_host_data.at(i) = static_cast<float>(gen_num);
+ mixed_data.at({{i}}) = {static_cast<double>(gen_num)};
+ float64_data.at({{i}}) = {static_cast<double>(gen_num)};
+ float32_data.at({{i}}) = {static_cast<float>(gen_num)};
}
- data<sch::MixedArray, encode::Sycl<encode::Native>> mixed_device_data{mixed_host_data};
- data<sch::Float64Array, encode::Sycl<encode::Native>> float64_device_data{float64_host_data};
- data<sch::Float32Array, encode::Sycl<encode::Native>> 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);
}
diff --git a/modules/remote-sycl/benchmarks/mixed_precision.hpp b/modules/remote-sycl/benchmarks/mixed_precision.hpp
index e21a2e6..f673538 100644
--- a/modules/remote-sycl/benchmarks/mixed_precision.hpp
+++ b/modules/remote-sycl/benchmarks/mixed_precision.hpp
@@ -34,8 +34,8 @@ using FloatPrecisionBenchmarkInterface = Interface<
>;
}
-saw::interface<sch::MixedPrecisionBenchmarkInterface, saw::encode::Sycl<saw::encode::Native>, cl::sycl::queue*> listen_mixed_precision(cl::sycl::event& mixed_ev, cl::sycl::event& float64_ev, cl::sycl::event& float32_ev, uint64_t& arithmetic_intensity);
+saw::interface<sch::MixedPrecisionBenchmarkInterface, saw::encode::Sycl<saw::encode::Native>, acpp::sycl::queue*> listen_mixed_precision(acpp::sycl::event& mixed_ev, acpp::sycl::event& float64_ev, acpp::sycl::event& float32_ev, uint64_t& arithmetic_intensity);
-saw::interface<sch::FloatPrecisionBenchmarkInterface<sch::MixedArray>, saw::encode::Sycl<saw::encode::Native>, cl::sycl::queue*> listen_mixed_float_precision(cl::sycl::event& ev, uint64_t& arithmetic_intensity);
-saw::interface<sch::FloatPrecisionBenchmarkInterface<sch::Float32Array>, saw::encode::Sycl<saw::encode::Native>, cl::sycl::queue*> listen_half_float_precision(cl::sycl::event& ev, uint64_t& arithmetic_intensity);
-saw::interface<sch::FloatPrecisionBenchmarkInterface<sch::Float64Array>, saw::encode::Sycl<saw::encode::Native>, cl::sycl::queue*> listen_full_precision(cl::sycl::event& ev, uint64_t& arithmetic_intensity);
+saw::interface<sch::FloatPrecisionBenchmarkInterface<sch::MixedArray>, saw::encode::Sycl<saw::encode::Native>, acpp::sycl::queue*> listen_mixed_float_precision(acpp::sycl::event& ev, uint64_t& arithmetic_intensity);
+saw::interface<sch::FloatPrecisionBenchmarkInterface<sch::Float32Array>, saw::encode::Sycl<saw::encode::Native>, acpp::sycl::queue*> listen_half_float_precision(acpp::sycl::event& ev, uint64_t& arithmetic_intensity);
+saw::interface<sch::FloatPrecisionBenchmarkInterface<sch::Float64Array>, saw::encode::Sycl<saw::encode::Native>, acpp::sycl::queue*> listen_full_precision(acpp::sycl::event& ev, uint64_t& arithmetic_intensity);