 // specialize thrust::less for tuple<size_t, complex<float>>
 template <>
 __host__ __device__ __forceinline__
-#if (__CUDACC_VER_MAJOR__ >11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ >= 2) || defined(__HIPCC__))
+#if (__CUDACC_VER_MAJOR__ >11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ >= 2) || HIP_VERSION >= 402)
 constexpr
 #endif
 bool less< tuple<size_t, complex<float>> >::operator() (

// specialize thrust::less for __half
template <>
__host__ __device__ __forceinline__
#if (__CUDACC_VER_MAJOR__ >11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ >= 2) || defined(__HIPCC__))
constexpr
#endif
bool less<__half>::operator() (const __half& lhs, const __half& rhs) const {

// specialize thrust::less for tuple<size_t, complex<double>>
template <>
__host__ __device__ __forceinline__
#if (__CUDACC_VER_MAJOR__ >11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ >= 2) || HIP_VERSION >= 402)
constexpr
#endif
bool less< tuple<size_t, complex<double>> >::operator() (
