Skip to content

Commit 7564d1c

Browse files
committed
Use is_complex_v in real and imag
1 parent 0a447ad commit 7564d1c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/imag.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ using dpctl::tensor::ssize_t;
5454
namespace td_ns = dpctl::tensor::type_dispatch;
5555

5656
using dpctl::tensor::type_utils::is_complex;
57+
using dpctl::tensor::type_utils::is_complex_v;
5758

5859
template <typename argT, typename resT> struct ImagFunctor
5960
{
@@ -70,7 +71,7 @@ template <typename argT, typename resT> struct ImagFunctor
7071

7172
resT operator()(const argT &in) const
7273
{
73-
if constexpr (is_complex<argT>::value) {
74+
if constexpr (is_complex_v<argT>) {
7475
using realT = typename argT::value_type;
7576
using sycl_complexT = typename exprm_ns::complex<realT>;
7677
return exprm_ns::imag(sycl_complexT(in));

dpctl/tensor/libtensor/include/kernels/elementwise_functions/real.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ using dpctl::tensor::ssize_t;
5454
namespace td_ns = dpctl::tensor::type_dispatch;
5555

5656
using dpctl::tensor::type_utils::is_complex;
57+
using dpctl::tensor::type_utils::is_complex_v;
5758

5859
template <typename argT, typename resT> struct RealFunctor
5960
{
@@ -70,7 +71,7 @@ template <typename argT, typename resT> struct RealFunctor
7071

7172
resT operator()(const argT &in) const
7273
{
73-
if constexpr (is_complex<argT>::value) {
74+
if constexpr (is_complex_v<argT>) {
7475
using realT = typename argT::value_type;
7576
using sycl_complexT = typename exprm_ns::complex<realT>;
7677
return exprm_ns::real(sycl_complexT(in));

0 commit comments

Comments
 (0)