Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Backend-specific targets #115

Open
stotko opened this issue Mar 6, 2020 · 0 comments
Open

cmake: Backend-specific targets #115

stotko opened this issue Mar 6, 2020 · 0 comments
Milestone

Comments

@stotko
Copy link
Owner

stotko commented Mar 6, 2020

The backend system is currently restricted to build and install the library only for a single backend.

Current behavior:

  • Set STDGPU_BACKEND to either STDGPU_BACKEND_CUDA (default) or STDGPU_BACKEND_OPENMP to control which backend will be used.
  • Build target stdgpu::stdgpu for the particular choice of STDGPU_BACKEND. Other backends will not be considered at all.

Proposed behavior:

  • Set STDGPU_ENABLE_<BACKEND> where <BACKEND> is one of CUDA, OPENMP.
  • Build backend targets stdgpu::<BACKEND> for each enabled backend using the backend-specific settings and dependency checks.
  • Define stdgpu::stdgpu as an alias target to stdgpu::<BACKEND> serving as a default which can be controlled via STDGPU_BACKEND to 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.

@stotko stotko added this to the 2.0.0 milestone Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant