File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
dpctl/tensor/libtensor/include/utils Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333* Fix warning in documentation generation caused by ` diff ` docstring [ gh-1855 ] ( https://github.com/IntelPython/dpctl/pull/1855 )
3434* Fix additional warnings when generating docs [ gh-1861 ] ( https://github.com/IntelPython/dpctl/pull/1861 )
3535* Add missing include of SYCL header to "math_utils.hpp" [ gh-1899 ] ( https://github.com/IntelPython/dpctl/pull/1899 )
36+ * Add support of CV-qualifiers in ` is_complex<T> ` helper [ gh-1900 ] ( https://github.com/IntelPython/dpctl/pull/1900 )
3637
3738## [ 0.18.1] - Oct. 11, 2024
3839
Original file line number Diff line number Diff line change 2626#include < complex>
2727#include < stdexcept>
2828#include < sycl/sycl.hpp>
29+ #include < type_traits>
2930#include < utility>
3031
3132namespace dpctl
@@ -35,13 +36,22 @@ namespace tensor
3536namespace type_utils
3637{
3738
38- template <class T > struct is_complex : std::false_type
39+ template <typename T, typename = void >
40+ struct is_complex : public std ::false_type
3941{
4042};
41- template <class T > struct is_complex <std::complex <T>> : std::true_type
43+
44+ template <typename T>
45+ struct is_complex <
46+ T,
47+ std::enable_if_t <std::is_same_v<std::remove_cv_t <T>, std::complex <float >> ||
48+ std::is_same_v<std::remove_cv_t <T>, std::complex <double >>>>
49+ : public std::true_type
4250{
4351};
4452
53+ template <typename T> constexpr bool is_complex_v = is_complex<T>::value;
54+
4555template <typename dstTy, typename srcTy> dstTy convert_impl (const srcTy &v)
4656{
4757 if constexpr (std::is_same<dstTy, srcTy>::value) {
You can’t perform that action at this time.
0 commit comments