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

Update device ID selection for HIP/CUDA/MAGMA backends #740

Merged
merged 1 commit into from
Apr 15, 2021

Conversation

nbeams
Copy link
Contributor

@nbeams nbeams commented Apr 12, 2021

This PR fixes the device ID selection for the CUDA/HIP backends while retaining the option to use /gpu/cuda or /gpu/hip as shortcuts for the best backends (currently chooses gen). It also adds the ability to set the device ID for the MAGMA backends.

The device ID string was chosen to match that of the OCCA backends, i.e., :device_id=#. An example full resource string would be /gpu/hip/shared:device_id=1.

Other minor changes include:

  • Change some headers to fix compiler warnings
  • Remove the backend data structs for the shared and gen backends, and have those backends use the base Ceed_Hip or Ceed_Cuda structs. (Previously, the shared and gen structs only contained a Ceed_Hip or Ceed_Cuda pointer called base, but nothing was ever accessed through base and the CUDA/HIP Init functions only ever assumed they were given the base struct directly.)

Resolves #709

@@ -16,7 +16,6 @@

#include <ceed/ceed.h>
#include <ceed/backend.h>
#include <stdbool.h>
#include <string.h>
#include "ceed-cuda-shared.h"
#include "../cuda/ceed-cuda.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of these days we'll have to decide how we want this reaching over into other backend's headers to work.

@nbeams
Copy link
Contributor Author

nbeams commented Apr 13, 2021

@jeremylt Do you think the Rust test failure is the same as what you were talking about on #739?

@jeremylt
Copy link
Member

Yes, there is a bug in the nightly builds of Rust, but the nightly builds are required for our current way of doing code coverage in Rust.

@jeremylt jeremylt merged commit ebc204c into main Apr 15, 2021
@jeremylt jeremylt deleted the natalie/device-id branch April 15, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPU resource names and device IDs
2 participants