File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
dpctl/tensor/libtensor/include/kernels/elementwise_functions Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ template <typename argT, typename resT> struct SinFunctor
58
58
// constant value, if constant
59
59
// constexpr resT constant_value = resT{};
60
60
// is function defined for sycl::vec
61
- using supports_vec = typename std::false_type;
61
+ using supports_vec = typename std::negation<
62
+ std::disjunction<is_complex<resT>, is_complex<argT>>>;
62
63
// do both argTy and resTy support sugroup store/load operation
63
64
using supports_sg_loadstore = typename std::negation<
64
65
std::disjunction<is_complex<resT>, is_complex<argT>>>;
@@ -181,6 +182,20 @@ template <typename argT, typename resT> struct SinFunctor
181
182
return std::sin (in);
182
183
}
183
184
}
185
+
186
+ template <int vec_sz>
187
+ sycl::vec<resT, vec_sz> operator ()(const sycl::vec<argT, vec_sz> &in)
188
+ {
189
+ auto const &res_vec = sycl::sin (in);
190
+ using deducedT = typename std::remove_cv_t <
191
+ std::remove_reference_t <decltype (res_vec)>>::element_type;
192
+ if constexpr (std::is_same_v<resT, deducedT>) {
193
+ return res_vec;
194
+ }
195
+ else {
196
+ return vec_cast<resT, deducedT, vec_sz>(res_vec);
197
+ }
198
+ }
184
199
};
185
200
186
201
template <typename argTy,
You can’t perform that action at this time.
0 commit comments