From c0549d71b2109f10c1238db8b22362e7826ba61b Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 5 Jul 2026 15:59:23 +0200 Subject: Just rename from lib to modules --- modules/sycl/tests/SConscript | 32 +++++++++++++++++++++++++ modules/sycl/tests/data.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 modules/sycl/tests/SConscript create mode 100644 modules/sycl/tests/data.cpp (limited to 'modules/sycl/tests') diff --git a/modules/sycl/tests/SConscript b/modules/sycl/tests/SConscript new file mode 100644 index 0000000..d1b381e --- /dev/null +++ b/modules/sycl/tests/SConscript @@ -0,0 +1,32 @@ +#!/bin/false + +import os +import os.path +import glob + + +Import('env') + +dir_path = Dir('.').abspath + +# Environment for base library +test_cases_env = env.Clone(); + +test_cases_env.Append(LIBS=['forstio-test']); + +test_cases_env.sources = sorted(glob.glob(dir_path + "/*.cpp")) +test_cases_env.headers = sorted(glob.glob(dir_path + "/*.hpp")) + +env.sources += test_cases_env.sources; +env.headers += test_cases_env.headers; + +objects_static = [] +test_cases_env.add_source_files(objects_static, test_cases_env.sources, shared=False); +test_cases_env.program = test_cases_env.Program('#bin/tests', [objects_static]); +# , env.library_static]); + +# Set Alias +env.Alias('test', test_cases_env.program); +env.Alias('check', test_cases_env.program); + +env.targets += ['test','check']; diff --git a/modules/sycl/tests/data.cpp b/modules/sycl/tests/data.cpp new file mode 100644 index 0000000..4321a0d --- /dev/null +++ b/modules/sycl/tests/data.cpp @@ -0,0 +1,56 @@ +#include + +#include "../c++/lbm.hpp" + +namespace { + +namespace sch { +using namespace kel::lbm::sch; +using TestObjSchema = Tuple< + Member, "foo">, + Member, "bar">, + Member< + Array< + Struct< + Member,"pos"> + > + >, + "baz" + > +>; +} + +SAW_TEST("Sycl Data Compilation"){ + acpp::sycl::queue q; + saw::data< + saw::schema::Struct< + saw::schema::Member< + kel::lbm::sch::Chunk, + "test" + > + >, + kel::lbm::encode::Sycl + > dat{q}; + + auto& test_f = dat.template get<"test">(); + + // test_f.at({}).set(1); + // SAW_EXPECT(test_f.at({}).get() == 1, "Value check failed"); +} + +SAW_TEST("Sycl Data Array of Struct"){ + acpp::sycl::queue q; + + saw::data, kel::lbm::encode::Sycl> a{{{2u}},q}; +} + +/* +SAW_TEST("Sycl Data Compilation for Particle Similacrum"){ + acpp::sycl::queue q; + + saw::data< + sch::TestObjSchema + > a; +} +*/ +} -- cgit v1.2.3