From f69658f574c8d4b8e776fe2b48a5db4cd0899f8c Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Fri, 20 Jan 2023 13:45:04 -0600 Subject: [PATCH] Utility validate_type_for_device must flag complex128 as it flags double --- dpctl/tensor/libtensor/include/utils/type_utils.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dpctl/tensor/libtensor/include/utils/type_utils.hpp b/dpctl/tensor/libtensor/include/utils/type_utils.hpp index b6f4a657f4..8464418d8b 100644 --- a/dpctl/tensor/libtensor/include/utils/type_utils.hpp +++ b/dpctl/tensor/libtensor/include/utils/type_utils.hpp @@ -76,14 +76,21 @@ template void validate_type_for_device(const sycl::device &d) if (!d.has(sycl::aspect::fp64)) { throw std::runtime_error("Device " + d.get_info() + - " does not support type 'double'"); + " does not support type 'float64'"); + } + } + else if constexpr (std::is_same_v>) { + if (!d.has(sycl::aspect::fp64)) { + throw std::runtime_error("Device " + + d.get_info() + + " does not support type 'complex128'"); } } else if constexpr (std::is_same_v) { if (!d.has(sycl::aspect::fp16)) { throw std::runtime_error("Device " + d.get_info() + - " does not support type 'half'"); + " does not support type 'float16'"); } } }