Skip to content

Commit 4be75e8

Browse files
committed
Use is_complex_v instead of is_complex<...>::value
Also make Caster object static constexpr in generic copy kernel as it is done in contig kernel.
1 parent 878cc19 commit 4be75e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpctl/tensor/libtensor/include/kernels/copy_and_cast.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class GenericCopyFunctor
101101
const ssize_t &src_offset = offsets.get_first_offset();
102102
const ssize_t &dst_offset = offsets.get_second_offset();
103103

104-
CastFnT fn{};
104+
static constexpr CastFnT fn{};
105105
dst_[dst_offset] = fn(src_[src_offset]);
106106
}
107107
};
@@ -237,9 +237,9 @@ class ContigCopyFunctor
237237

238238
static constexpr std::uint8_t elems_per_wi = n_vecs * vec_sz;
239239

240-
using dpctl::tensor::type_utils::is_complex;
241-
if constexpr (!enable_sg_loadstore || is_complex<srcT>::value ||
242-
is_complex<dstT>::value)
240+
using dpctl::tensor::type_utils::is_complex_v;
241+
if constexpr (!enable_sg_loadstore || is_complex_v<srcT> ||
242+
is_complex_v<dstT>)
243243
{
244244
std::uint16_t sgSize = ndit.get_sub_group().get_local_range()[0];
245245
const std::size_t gid = ndit.get_global_linear_id();

0 commit comments

Comments
 (0)