18 #if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) || defined(ALPAKA_ACC_GPU_HIP_ENABLED)
20 # ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
22 # include <cuda_runtime.h>
25 # ifdef ALPAKA_ACC_GPU_HIP_ENABLED
26 # include <hip/hip_runtime.h>
34 tuple<char1, double1, float1, int1, long1, longlong1, short1, uchar1, uint1, ulong1, ulonglong1, ushort1>;
36 tuple<char2, double2, float2, int2, long2, longlong2, short2, uchar2, uint2, ulong2, ulonglong2, ushort2>;
53 # if BOOST_COMP_CLANG_CUDA
55 __cuda_builtin_threadIdx_t,
56 __cuda_builtin_blockIdx_t,
57 __cuda_builtin_blockDim_t,
58 __cuda_builtin_gridDim_t
62 tuple<char4, double4, float4, int4, long4, longlong4, short4, uchar4, uint4, ulong4, ulonglong4, ushort4>;
64 Concatenate<CudaHipBuiltinTypes1, CudaHipBuiltinTypes2, CudaHipBuiltinTypes3, CudaHipBuiltinTypes4>;
70 # ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
78 # ifdef ALPAKA_ACC_GPU_HIP_ENABLED
82 inline constexpr
auto isHipBuiltInType = alpaka::detail::isCudaHipBuiltInType<T>;
90 struct DimType<T, std::enable_if_t<meta::Contains<alpaka::detail::CudaHipBuiltinTypes1, T>::value>>
97 struct DimType<T, std::enable_if_t<meta::Contains<alpaka::detail::CudaHipBuiltinTypes2, T>::value>>
104 struct DimType<T, std::enable_if_t<meta::Contains<alpaka::detail::CudaHipBuiltinTypes3, T>::value>>
111 struct DimType<T, std::enable_if_t<meta::Contains<alpaka::detail::CudaHipBuiltinTypes4, T>::value>>
118 struct ElemType<T, std::enable_if_t<alpaka::detail::isCudaHipBuiltInType<T>>>
120 using type = decltype(std::declval<T>().x);
123 template<
typename TCudaHipBuiltin>
124 struct GetExtents<TCudaHipBuiltin, std::enable_if_t<alpaka::detail::isCudaHipBuiltInType<TCudaHipBuiltin>>>
131 if constexpr(dim == 1)
133 else if constexpr(dim == 2)
134 return {value.y, value.x};
135 else if constexpr(dim == 3)
136 return {value.z, value.y, value.x};
137 else if constexpr(dim == 4)
138 return {value.w, value.z, value.y, value.x};
140 static_assert(
sizeof(value) == 0,
"Not implemented");
146 template<
typename TCudaHipBuiltin>
147 struct GetOffsets<TCudaHipBuiltin, std::enable_if_t<alpaka::detail::isCudaHipBuiltInType<TCudaHipBuiltin>>>
153 template<
typename TIdx>
154 struct IdxType<TIdx, std::enable_if_t<alpaka::detail::isCudaHipBuiltInType<TIdx>>>
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
#define ALPAKA_FN_HOST_ACC
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
constexpr auto isCudaBuiltInType
std::tuple< char3, dim3, double3, float3, int3, long3, longlong3, short3, uchar3, uint3, ulong3, ulonglong3, ushort3 > CudaHipBuiltinTypes3
constexpr auto isCudaHipBuiltInType
std::tuple< char2, double2, float2, int2, long2, longlong2, short2, uchar2, uint2, ulong2, ulonglong2, ushort2 > CudaHipBuiltinTypes2
std::tuple< char1, double1, float1, int1, long1, longlong1, short1, uchar1, uint1, ulong1, ulonglong1, ushort1 > CudaHipBuiltinTypes1
meta::Concatenate< CudaHipBuiltinTypes1, CudaHipBuiltinTypes2, CudaHipBuiltinTypes3, CudaHipBuiltinTypes4 > CudaHipBuiltinTypes
std::tuple< char4, double4, float4, int4, long4, longlong4, short4, uchar4, uint4, ulong4, ulonglong4, ushort4 > CudaHipBuiltinTypes4
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
std::integral_constant< std::size_t, N > DimInt
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
The dimension getter type trait.
decltype(std::declval< T >().x) type
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(TCudaHipBuiltin const &value) const -> Vec< Dim< TCudaHipBuiltin >, Idx< TCudaHipBuiltin >>
The GetExtents trait for getting the extents of an object as an alpaka::Vec.
The GetOffsets trait for getting the offsets of an object as an alpaka::Vec.