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
33
33
* Fix warning in documentation generation caused by ` diff ` docstring [ gh-1855 ] ( https://github.com/IntelPython/dpctl/pull/1855 )
34
34
* Fix additional warnings when generating docs [ gh-1861 ] ( https://github.com/IntelPython/dpctl/pull/1861 )
35
35
* 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 )
36
37
37
38
## [ 0.18.1] - Oct. 11, 2024
38
39
Original file line number Diff line number Diff line change 26
26
#include < complex>
27
27
#include < stdexcept>
28
28
#include < sycl/sycl.hpp>
29
+ #include < type_traits>
29
30
#include < utility>
30
31
31
32
namespace dpctl
@@ -35,13 +36,22 @@ namespace tensor
35
36
namespace type_utils
36
37
{
37
38
38
- template <class T > struct is_complex : std::false_type
39
+ template <typename T, typename = void >
40
+ struct is_complex : public std ::false_type
39
41
{
40
42
};
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
42
50
{
43
51
};
44
52
53
+ template <typename T> constexpr bool is_complex_v = is_complex<T>::value;
54
+
45
55
template <typename dstTy, typename srcTy> dstTy convert_impl (const srcTy &v)
46
56
{
47
57
if constexpr (std::is_same<dstTy, srcTy>::value) {
You can’t perform that action at this time.
0 commit comments