-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
Milestone
Description
The backend system is currently restricted to build and install the library only for a single backend.
Current behavior:
- Set
STDGPU_BACKENDto eitherSTDGPU_BACKEND_CUDA(default) orSTDGPU_BACKEND_OPENMPto control which backend will be used. - Build target
stdgpu::stdgpufor the particular choice ofSTDGPU_BACKEND. Other backends will not be considered at all.
Proposed behavior:
- Set
STDGPU_ENABLE_<BACKEND>where<BACKEND>is one ofCUDA,OPENMP. - Build backend targets
stdgpu::<BACKEND>for each enabled backend using the backend-specific settings and dependency checks. - Define
stdgpu::stdgpuas an alias target tostdgpu::<BACKEND>serving as a default which can be controlled viaSTDGPU_BACKENDto match current behavior.
This will make the system more flexible and allow users to choose freely between all enabled backends in their projects rather than being globally restricted to a single choice. Note that linking to more than one backend at the same time will be considered undefined behavior/ODR violation.
Furthermore, if only a single backend should be used at all times, this intend can also be expressed more clearly by linking to stdgpu::<BACKEND> rather than the configuration-dependent stdgpu::stdgpu target.