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

More robust cuda and cupy identification #657

Merged
merged 3 commits into from Mar 25, 2022

Conversation

ianthomas23
Copy link
Contributor

This PR makes the identification of cuda and cupy more robust. Previously it was possible to have cuda present but not have cupy installed, and some branches of code would view this as sufficient for running cupy code and hence fail.

The change is to add a new function has_cuda_and_cupy that combines the individual has_cuda and has_cupy functions, which are now made private with underscores. Existing code has been modified to use the new has_cuda_and_cupy(), and all new code should use this too.

Also added a pytest.mark.skipif decorator called cuda_and_cupy_available so we don't have to repeat the reason string throughout the code.

I have confirmed that tests run and pass on a cuda-enabled system in the following configurations:

  1. No cupy
  2. With cupy
  3. With cupy and rtxpy

@brendancol
Copy link
Contributor

@ianthomas23 nice this sounds good. Ive added @thuydotm as reviewer

@ianthomas23 ianthomas23 merged commit 77d3168 into makepath:master Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants