Skip to content

Commit 6c99e65

Browse files
authored
Implement a helper alias template for complex types (#1644)
1 parent 1e86753 commit 6c99e65

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dpnp/backend/kernels/dpnp_krnl_fft.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ DPCTLSyclEventRef dpnp_fft_fft_c(DPCTLSyclQueueRef q_ref,
414414
const size_t norm,
415415
const DPCTLEventVectorRef dep_event_vec_ref)
416416
{
417-
static_assert(sycl::detail::is_complex<_DataType_output>::value,
417+
static_assert(is_complex<_DataType_output>::value,
418418
"Output data type must be a complex type.");
419419

420420
DPCTLSyclEventRef event_ref = nullptr;
@@ -584,7 +584,7 @@ DPCTLSyclEventRef dpnp_fft_rfft_c(DPCTLSyclQueueRef q_ref,
584584
const size_t norm,
585585
const DPCTLEventVectorRef dep_event_vec_ref)
586586
{
587-
static_assert(sycl::detail::is_complex<_DataType_output>::value,
587+
static_assert(is_complex<_DataType_output>::value,
588588
"Output data type must be a complex type.");
589589
DPCTLSyclEventRef event_ref = nullptr;
590590

dpnp/backend/src/dpnp_fptr.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,18 @@ template <typename _Tp>
219219
using dpnp_remove_cvref_t =
220220
typename std::remove_cv_t<typename std::remove_reference_t<_Tp>>;
221221

222+
/**
223+
* A helper alias template to return true value for complex types and false
224+
* otherwise.
225+
*/
226+
template <typename _Tp>
227+
struct is_complex : public std::integral_constant<
228+
bool,
229+
std::is_same_v<_Tp, std::complex<float>> ||
230+
std::is_same_v<_Tp, std::complex<double>>>
231+
{
232+
};
233+
222234
/**
223235
* @brief "<" comparison with complex types support.
224236
*

0 commit comments

Comments
 (0)