Skip to content

Runtime memory policy for multireducers #1756

@tomstitt

Description

@tomstitt

Is your feature request related to a problem? Please describe.

The RAJA::hip_multi_reduce_atomic and RAJA::cuda_multi_reduce_atomic multireducers allocate GPU memory even when they are only used in a CPU kernel. Our application supports a runtime compute policy with GPU builds such that we can run CPU-only if desired; with multireducers this breaks because in CPU mode we now allocate GPU memory.

Describe the solution you'd like

We would like the GPU multireducers to dynamically choose their allocator based on the the kernel they are captured by, similar to the regular GPU RAJA reducers like RAJA::hip_reduce and RAJA::cuda_reduce.

Describe alternatives you've considered

We've considered templating routines where we use multireducers with a sequential dispatch for the CPU and a platform-dependent dispatch for the GPU but that requires additional boilerplate.

Additional context

n/a

Metadata

Metadata

Assignees

Labels

API/usabilityreviewedMark with this label when issue has been discussed by team

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions