Skip to content

Commit

Permalink
correctly define permutation map
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKoch committed Aug 17, 2023
1 parent 09bfa7f commit 8393dca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dpcpp/distributed/partition_helpers_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ namespace dpcpp {
namespace partition_helpers {

struct stride {
// Some version requires [] while some requires (), so I added both
#if ONEDPL_VERSION_MAJOR >= 2022 && ONEDPL_VERSION_MINOR >= 1
template <typename Index>
Index operator()(const Index& i) const
{
return i * 2;
}
#else
// Some older version require [] while some require (), so I added both
template <typename Index>
Index operator[](const Index& i) const
{
Expand All @@ -56,8 +63,9 @@ struct stride {
template <typename Index>
Index operator()(const Index& i) const
{
return operator[](i);
return i * 2;
}
#endif
};

template <typename GlobalIndexType>
Expand Down

0 comments on commit 8393dca

Please sign in to comment.