Commit 891be203 authored by Paul's avatar Paul
Browse files

Add group stride

parent b8b2e8ab
...@@ -130,6 +130,8 @@ struct index ...@@ -130,6 +130,8 @@ struct index
return blockDim.x; return blockDim.x;
} }
#endif #endif
constexpr auto ngroup() const { return nglobal() / max_nlocal(); }
template <class N, class Stride> template <class N, class Stride>
static constexpr auto max_stride_iterations(N n, Stride stride) static constexpr auto max_stride_iterations(N n, Stride stride)
{ {
...@@ -231,6 +233,12 @@ struct index ...@@ -231,6 +233,12 @@ struct index
{ {
for_stride<true>(local, n, nlocal(), f); for_stride<true>(local, n, nlocal(), f);
} }
template <class F, class N>
__device__ void group_stride(N n, F f) const
{
for_stride<false>(group, n, ngroup(), f);
}
}; };
#ifdef MIGRAPHX_NLOCAL #ifdef MIGRAPHX_NLOCAL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment