Stream: helpdesk (published)

Topic: Package testing if GPU available


view this post on Zulip Dale Black (Oct 13 2021 at 20:12):

When developing packages that have portions that utilize CUDA.jl, is there a best practice way to write tests that test the GPU-specific functions if and only if a CUDA-enabled GPU is available?

view this post on Zulip Brian Chen (Oct 13 2021 at 22:20):

Flux uses CUDA.functional() for this: https://github.com/FluxML/Flux.jl/blob/c91867fd8cc49b19d90c88e0346db674cb757abd/test/runtests.jl#L30-L49

view this post on Zulip Dale Black (Oct 13 2021 at 23:12):

Thank you!


Last updated: Oct 02 2023 at 04:34 UTC