summaryrefslogtreecommitdiff
path: root/lib/sycl/c++/index.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-04-28 16:59:20 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-04-28 16:59:20 +0200
commit4e5aca56ba3e3ca989f3e6934fc1439b8de2ca08 (patch)
treeab015fbd83e7d229cc51686665a47376e1efec42 /lib/sycl/c++/index.hpp
parenta2aa6f728f25a0e0d33cdb84c7ea2ae78688db0e (diff)
downloadlibs-lbm-4e5aca56ba3e3ca989f3e6934fc1439b8de2ca08.tar.gz
Helper function to transform index
Diffstat (limited to 'lib/sycl/c++/index.hpp')
-rw-r--r--lib/sycl/c++/index.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/sycl/c++/index.hpp b/lib/sycl/c++/index.hpp
new file mode 100644
index 0000000..0d2c035
--- /dev/null
+++ b/lib/sycl/c++/index.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "common.hpp"
+
+namespace kel {
+namespace lbm {
+template<typename D>
+saw::data<sch::FixedArray<sch::UInt64,D>> sycl_to_saw_index(const acpp::sycl::id<D>& idx){
+ saw::data<sch::FixedArray<sch::UInt64,D>> trans_index;
+
+ for(uint64_t i{0u}; i < D; ++i){
+ trans_index.at({{i}}).set(idx[i]);
+ }
+
+ return trans_index;
+}
+}
+}