RAJA icon indicating copy to clipboard operation
RAJA copied to clipboard

Consider allowing the regular reference for the single-component reducer types

Open artv3 opened this issue 1 year ago • 0 comments

Drawing from the conversation in: https://github.com/LLNL/RAJA/pull/1759#discussion_r1866293836

From @trws:

`` On the *loc objects, it makes sense to me to have a helper type for those that has an loc or similar on it, but why not allow the regular reference for the single-component types? It's sometimes useful to do different operations in the body than at the actual reduction. Usually that's for things like getting a per-thread value, like "max iterations computed by one thread" or similar, but it does occasionally come up.

To be explicit, I think the ValOp types are a good idea like the strongly-typed indexes, but it seems like something that should be optional rather than required. Also, I would expect to be able to get it by doing RAJA::expt::Reduce<RAJA::operators::plus, int>::arg_type, or decltype(RAJA::expt::ReduceRAJA::operators::plus(&sum))::arg_type, or similar so the declaration for the type used to pass in the reducer provides the appropriate ValOp type.``

artv3 avatar Dec 05 '24 17:12 artv3