13 #ifdef ALPAKA_ACC_SYCL_ENABLED
15 # include <sycl/sycl.hpp>
20 template<
typename TDim,
typename TIdx>
21 class IdxGbGenericSycl :
public interface::Implements<ConceptIdxGb, IdxGbGenericSycl<TDim, TIdx>>
24 using IdxGbBase = IdxGbGenericSycl;
26 explicit IdxGbGenericSycl(sycl::nd_item<TDim::value> work_item) : m_item_gb{work_item}
30 sycl::nd_item<TDim::value> m_item_gb;
37 template<
typename TDim,
typename TIdx>
38 struct DimType<gb::IdxGbGenericSycl<TDim, TIdx>>
44 template<
typename TDim,
typename TIdx>
45 struct GetIdx<gb::IdxGbGenericSycl<TDim, TIdx>, origin::Grid, unit::Blocks>
48 template<
typename TWorkDiv>
49 static auto getIdx(gb::IdxGbGenericSycl<TDim, TIdx>
const& idx, TWorkDiv
const&)
51 if constexpr(TDim::value == 1)
52 return
Vec<TDim, TIdx>(static_cast<TIdx>(idx.m_item_gb.get_group(0)));
53 else if constexpr(TDim::value == 2)
55 return Vec<TDim, TIdx>(
56 static_cast<TIdx
>(idx.m_item_gb.get_group(1)),
57 static_cast<TIdx
>(idx.m_item_gb.get_group(0)));
61 return Vec<TDim, TIdx>(
62 static_cast<TIdx
>(idx.m_item_gb.get_group(2)),
63 static_cast<TIdx
>(idx.m_item_gb.get_group(1)),
64 static_cast<TIdx
>(idx.m_item_gb.get_group(0)));
70 template<
typename TDim,
typename TIdx>
71 struct IdxType<gb::IdxGbGenericSycl<TDim, TIdx>>
ALPAKA_FN_HOST_ACC Vec(TFirstIndex &&, TRestIndices &&...) -> Vec< DimInt< 1+sizeof...(TRestIndices)>, std::decay_t< TFirstIndex >>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getIdx(TIdx const &idx, TWorkDiv const &workDiv) -> Vec< Dim< TWorkDiv >, Idx< TIdx >>
Get the indices requested.