13 #ifdef ALPAKA_ACC_SYCL_ENABLED
15 # include <sycl/sycl.hpp>
20 template<
typename TDim,
typename TIdx>
21 class IdxBtGenericSycl :
public interface::Implements<ConceptIdxBt, IdxBtGenericSycl<TDim, TIdx>>
24 using IdxBtBase = IdxBtGenericSycl;
26 explicit IdxBtGenericSycl(sycl::nd_item<TDim::value> work_item) : m_item_bt{work_item}
30 sycl::nd_item<TDim::value> m_item_bt;
37 template<
typename TDim,
typename TIdx>
38 struct DimType<bt::IdxBtGenericSycl<TDim, TIdx>>
44 template<
typename TDim,
typename TIdx>
45 struct GetIdx<bt::IdxBtGenericSycl<TDim, TIdx>, origin::Block, unit::Threads>
48 template<
typename TWorkDiv>
49 static auto getIdx(bt::IdxBtGenericSycl<TDim, TIdx>
const& idx, TWorkDiv
const&) -> Vec<TDim, TIdx>
51 if constexpr(TDim::value == 1)
52 return
Vec<TDim, TIdx>{
static_cast<TIdx
>(idx.m_item_bt.get_local_id(0))};
53 else if constexpr(TDim::value == 2)
55 return Vec<TDim, TIdx>{
56 static_cast<TIdx
>(idx.m_item_bt.get_local_id(1)),
57 static_cast<TIdx
>(idx.m_item_bt.get_local_id(0))};
61 return Vec<TDim, TIdx>{
62 static_cast<TIdx
>(idx.m_item_bt.get_local_id(2)),
63 static_cast<TIdx
>(idx.m_item_bt.get_local_id(1)),
64 static_cast<TIdx
>(idx.m_item_bt.get_local_id(0))};
70 template<
typename TDim,
typename TIdx>
71 struct IdxType<bt::IdxBtGenericSycl<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.