20 #include <type_traits>
23 #ifdef ALPAKA_ACC_SYCL_ENABLED
25 # include <sycl/sycl.hpp>
32 # ifdef __SYCL_DEVICE_ONLY__
33 using AlpakaFormat =
char const* [[clang::opencl_constant]];
35 using AlpakaFormat =
char const*;
39 # pragma clang diagnostic push
40 # pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
43 # define printf(FORMAT, ...) \
46 static auto const format = AlpakaFormat{FORMAT}; \
47 sycl::ext::oneapi::experimental::printf(format, ##__VA_ARGS__); \
51 # pragma clang diagnostic pop
62 template<
typename T,
typename... Ts>
63 struct is_any : std::bool_constant<(std::is_same_v<T, Ts> || ...)>
74 struct IsSyclBuiltInType
153 struct DimType<T, std::enable_if_t<IsSyclBuiltInType<T>::value>>
155 using type = std::conditional_t<std::is_scalar_v<T>,
DimInt<std::size_t{1}>,
DimInt<T::size()>>;
160 struct ElemType<T, std::enable_if_t<IsSyclBuiltInType<T>::value>>
162 using type = std::conditional_t<std::is_scalar_v<T>, T,
typename T::element_type>;
167 struct GetExtents<T, std::enable_if_t<IsSyclBuiltInType<T>::value>>
169 auto operator()(T
const& value)
const
171 if constexpr(std::is_scalar_v<T>)
174 return impl(value, std::make_index_sequence<Dim<T>::value>{});
178 template<std::size_t... Is>
179 auto impl(T
const& value, std::index_sequence<Is...>)
const
181 return Vec{value.template swizzle<Is>()...};
187 struct GetOffsets<T, std::enable_if_t<IsSyclBuiltInType<T>::value>> : GetExtents<T>
192 template<
typename TIdx>
193 struct IdxType<TIdx, std::enable_if_t<IsSyclBuiltInType<TIdx>::value>>
195 using type = std::size_t;
The alpaka accelerator library.
ALPAKA_FN_HOST_ACC Vec(TFirstIndex &&, TRestIndices &&...) -> Vec< DimInt< 1+sizeof...(TRestIndices)>, std::decay_t< TFirstIndex >>
std::integral_constant< std::size_t, N > DimInt