From b514d9e6dfceafb83cebcbb0c7ef4728b2ff0401 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 18 Nov 2025 22:46:33 +0100 Subject: Sycl mixed precision prep --- .../benchmarks/mixed_precision_alternative.cpp | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/remote-sycl/benchmarks/mixed_precision_alternative.cpp (limited to 'modules/remote-sycl/benchmarks/mixed_precision_alternative.cpp') diff --git a/modules/remote-sycl/benchmarks/mixed_precision_alternative.cpp b/modules/remote-sycl/benchmarks/mixed_precision_alternative.cpp new file mode 100644 index 0000000..e1a1e90 --- /dev/null +++ b/modules/remote-sycl/benchmarks/mixed_precision_alternative.cpp @@ -0,0 +1,35 @@ +#include "../c++/data.hpp" + +namespace sch { +using namespace saw::schema; +} + +template +void inner_work(){ + acpp::sycl::queue sycl_q; + + constexpr uint64_t dat_size = 10000u; + + data, encode::Sycl> dat{{{dat_size}},sycl_q}; + data>, encode::Sycl> dat_ref{dat}; + auto dat_ptr = dat_ref.get_internal_data(); + + sycl_q.parallel_for(dat_size, [=](acpp::sycl::id<1> idx){ + size_t i = idx[0]; + + dat_ptr[i] = {i}; + }).wait(); + + for(uint64_t i = 0u; i < dat_size; ++i){ + SAW_EXPECT(dat_ptr[i].get() == i, std::string{"Unexpected value: "} + std::to_string(i)); + } + +} + +int main(){ + using namespace saw; + inner_work(); + inner_work(); + inner_work>(); + return 0; +} -- cgit v1.2.3