File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11#include " set_rows.hpp"
22
3+ namespace utils {
4+ template <typename T>
5+ static constexpr bool is_arithmetic_v () {
6+ return std::is_arithmetic_v<T> || std::is_same_v<T, sycl::half> || std::is_same_v<T, sycl::ext::oneapi::bfloat16>;
7+ }
8+ }
39template <typename TIn, typename TOut>
4- static inline void convert (const char * src, char * dst) {
10+ static inline std::enable_if_t <utils::is_arithmetic_v<TIn>() && utils::is_arithmetic_v<TOut>(), void >
11+ convert (const char * src, char * dst) {
512 auto src_val = *reinterpret_cast <const TIn*>(src);
6- auto dst_val = sycl::vec<TIn, 1 >(src_val).template convert <TOut>()[0 ];
7- *reinterpret_cast <TOut*>(dst) = dst_val;
13+ auto dst_val = sycl::vec<TIn, 1 >(src_val).template convert <TOut, sycl::rounding_mode::automatic >()[0 ];
14+ *reinterpret_cast <TOut*>(dst) = dst_val; ;
815}
916
1017template <typename TIn, typename TOut>
You can’t perform that action at this time.
0 commit comments