Skip to content

Commit a7c3e8a

Browse files
Merge pull request #1040 from IntelPython/expand-validate-type-for-device
Utility validate_type_for_device must flag complex128 as it flags double
2 parents 83ad22d + f69658f commit a7c3e8a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dpctl/tensor/libtensor/include/utils/type_utils.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,21 @@ template <typename T> void validate_type_for_device(const sycl::device &d)
7676
if (!d.has(sycl::aspect::fp64)) {
7777
throw std::runtime_error("Device " +
7878
d.get_info<sycl::info::device::name>() +
79-
" does not support type 'double'");
79+
" does not support type 'float64'");
80+
}
81+
}
82+
else if constexpr (std::is_same_v<T, std::complex<double>>) {
83+
if (!d.has(sycl::aspect::fp64)) {
84+
throw std::runtime_error("Device " +
85+
d.get_info<sycl::info::device::name>() +
86+
" does not support type 'complex128'");
8087
}
8188
}
8289
else if constexpr (std::is_same_v<T, sycl::half>) {
8390
if (!d.has(sycl::aspect::fp16)) {
8491
throw std::runtime_error("Device " +
8592
d.get_info<sycl::info::device::name>() +
86-
" does not support type 'half'");
93+
" does not support type 'float16'");
8794
}
8895
}
8996
}

0 commit comments

Comments
 (0)