I’m developing a package with both GPU routines and a CPU fall-back. I have two related queries:
- How should I best determine if a CUDA device is available?
- What would be the best way to avoid forcing CUDA dependencies on a user without a GPU?
My current solution would be to define the CUDA-requiring functions conditionally on readstring(
deviceQuery) not failing. This feels a bit dirty though - is there a better way?
Thoughts much appreciated.