File tree 1 file changed +16
-1
lines changed
dpctl/tensor/libtensor/include/kernels/elementwise_functions
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ template <typename argT, typename resT> struct SinFunctor
57
57
// constant value, if constant
58
58
// constexpr resT constant_value = resT{};
59
59
// is function defined for sycl::vec
60
- using supports_vec = typename std::false_type;
60
+ using supports_vec = typename std::negation<
61
+ std::disjunction<is_complex<resT>, is_complex<argT>>>;
61
62
// do both argTy and resTy support sugroup store/load operation
62
63
using supports_sg_loadstore = typename std::negation<
63
64
std::disjunction<is_complex<resT>, is_complex<argT>>>;
@@ -66,6 +67,20 @@ template <typename argT, typename resT> struct SinFunctor
66
67
{
67
68
return std::sin (in);
68
69
}
70
+
71
+ template <int vec_sz>
72
+ sycl::vec<resT, vec_sz> operator ()(const sycl::vec<argT, vec_sz> &in)
73
+ {
74
+ auto const &res_vec = sycl::sin (in);
75
+ using deducedT = typename std::remove_cv_t <
76
+ std::remove_reference_t <decltype (res_vec)>>::element_type;
77
+ if constexpr (std::is_same_v<resT, deducedT>) {
78
+ return res_vec;
79
+ }
80
+ else {
81
+ return vec_cast<resT, deducedT, vec_sz>(res_vec);
82
+ }
83
+ }
69
84
};
70
85
71
86
template <typename argTy,
You can’t perform that action at this time.
0 commit comments