Skip to content

Commit 79d4e9f

Browse files
committed
Use is_complex_v in real and imag
1 parent a81275e commit 79d4e9f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ template <typename argT, typename resT> struct ImagFunctor
7171

7272
resT operator()(const argT &in) const
7373
{
74-
if constexpr (is_complex<argT>::value) {
74+
if constexpr (is_complex_v<argT>) {
7575
return std::imag(in);
7676
}
7777
else {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ using dpctl::tensor::ssize_t;
5353
namespace td_ns = dpctl::tensor::type_dispatch;
5454

5555
using dpctl::tensor::type_utils::is_complex;
56+
using dpctl::tensor::type_utils::is_complex_v;
5657

5758
template <typename argT, typename resT> struct RealFunctor
5859
{
@@ -69,7 +70,7 @@ template <typename argT, typename resT> struct RealFunctor
6970

7071
resT operator()(const argT &in) const
7172
{
72-
if constexpr (is_complex<argT>::value) {
73+
if constexpr (is_complex_v<argT>) {
7374
return std::real(in);
7475
}
7576
else {

0 commit comments

Comments
 (0)