diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-08-30 19:02:15 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-08-30 19:04:11 +0200 |
commit | a1583da62ea0f7e9affe868cd509557b5e91fae3 (patch) | |
tree | 5d5261d24c81f33f81a930bdfc42fe9904915d9e /modules/codec/c++ | |
parent | 6379fe9ca2cad3d0c9d886e7808b1d579ce349c2 (diff) |
Fixing sycldev
Diffstat (limited to 'modules/codec/c++')
-rw-r--r-- | modules/codec/c++/math.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/codec/c++/math.hpp b/modules/codec/c++/math.hpp index dd9e49b..ddeea3f 100644 --- a/modules/codec/c++/math.hpp +++ b/modules/codec/c++/math.hpp @@ -4,9 +4,22 @@ namespace saw { namespace math { +/* template<typename T, typename Encoding = encode::Native> data<typename T::InnerType,Encoding> norm_2(const data<T,Encoding>& d){ return {}; } +*/ + +template<typename T, uint64_t D, typename Encoding = encode::Native> +data<schema::Scalar<T>, Encoding> dot(const data<schema::Vector<T,D>, Encoding>& left, const data<schema::Vector<T,D>, Encoding>& right){ + data<schema::Scalar<T>,Encoding> val; + auto& inner = val({}); + for(uint64_t i = 0u; i < D; ++i){ + inner = inner + left({{i}}) * right({{i}}); + } + + return val; +} } } |