Here's what I propose (I'll make an issue):
In a separate PR, create a struct which encapsulates this in two layers:
-
struct scan_through_elements_helper- created once per kernel, with a few public entry points which have template arguments for the constexpr fields which change from invocation to invocation within a kernel (__init_present for instance). Pull in the 2 usages of dispatch as named functions of this struct, to allow it to be a private helper.
-
struct sub_group_scan - toggle on or off inclusive_scan at the struct level, with 2 public entry points for scan and partial_scan, each templated with __init_present.
I think it makes sense to wait until after #2657, since some template parameters go away with that PR.
Originally posted by @danhoeflinger in #2709 (comment)
Here's what I propose (I'll make an issue):
In a separate PR, create a struct which encapsulates this in two layers:
struct scan_through_elements_helper- created once per kernel, with a few public entry points which have template arguments for the constexpr fields which change from invocation to invocation within a kernel (
__init_presentfor instance). Pull in the 2 usages of dispatch as named functions of this struct, to allow it to be a private helper.struct sub_group_scan - toggle on or off
inclusive_scanat the struct level, with 2 public entry points forscanandpartial_scan, each templated with__init_present.I think it makes sense to wait until after #2657, since some template parameters go away with that PR.
Originally posted by @danhoeflinger in #2709 (comment)