File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
dpnp/backend/extensions/vm Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,18 @@ namespace ext
38
38
{
39
39
namespace vm
40
40
{
41
+ template <typename T>
42
+ struct value_type_of
43
+ {
44
+ using type = T;
45
+ };
46
+
47
+ template <typename T>
48
+ struct value_type_of <std::complex<T>>
49
+ {
50
+ using type = typename std::complex<T>::value_type;
51
+ };
52
+
41
53
template <typename T>
42
54
sycl::event abs_contig_impl (sycl::queue exec_q,
43
55
const std::int64_t n,
@@ -48,7 +60,8 @@ sycl::event abs_contig_impl(sycl::queue exec_q,
48
60
type_utils::validate_type_for_device<T>(exec_q);
49
61
50
62
const T *a = reinterpret_cast <const T *>(in_a);
51
- T *y = reinterpret_cast <T *>(out_y);
63
+ using OutT = typename value_type_of<T>::type;
64
+ OutT *y = reinterpret_cast <OutT *>(out_y);
52
65
53
66
return mkl_vm::abs (exec_q,
54
67
n, // number of elements to be calculated
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ template <typename T>
53
53
struct AbsOutputType
54
54
{
55
55
using value_type = typename std::disjunction<
56
- // TODO: Add complex type here, currently adding them here generates a
57
- // compile time error due to probably a bug in mkl
56
+ dpctl_td_ns::TypeMapResultEntry<T, std:: complex< double >>,
57
+ dpctl_td_ns::TypeMapResultEntry<T, std::complex< float >>,
58
58
dpctl_td_ns::TypeMapResultEntry<T, double >,
59
59
dpctl_td_ns::TypeMapResultEntry<T, float >,
60
60
dpctl_td_ns::DefaultResultEntry<void >>::result_type;
You can’t perform that action at this time.
0 commit comments