From a1583da62ea0f7e9affe868cd509557b5e91fae3 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 30 Aug 2025 19:02:15 +0200 Subject: Fixing sycl --- modules/codec/tests/math.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/codec/tests') diff --git a/modules/codec/tests/math.cpp b/modules/codec/tests/math.cpp index ad2d9a6..4fb012f 100644 --- a/modules/codec/tests/math.cpp +++ b/modules/codec/tests/math.cpp @@ -1,6 +1,7 @@ #include #include "../c++/data.hpp" #include "../c++/data_math.hpp" +#include "../c++/math.hpp" #include "../c++/csv.hpp" #include @@ -55,4 +56,23 @@ SAW_TEST("Math/Tensor"){ SAW_EXPECT(d.at({{1u,1u}}).get() == 1.0, std::string{"Unexpected value at (1,1): "} + std::to_string(d.at({{1u,1u}}).get())); } } + +SAW_TEST("Math/Dot"){ + using namespace saw; + + data> a; + { + a.at({{0u}}) = 2.0; + a.at({{1u}}) = 1.0; + } + data> b; + { + b.at({{0u}}) = -1.0; + b.at({{1u}}) = 5.0; + } + + auto c = math::dot(a,b); + + SAW_EXPECT(c.at({}).get() == 3.0, std::string{"Unexpected value for dot product "} + std::to_string(c.at({}).get()) ); +} } -- cgit v1.2.3