Currently, to run tests on either GPU or CPU using runtests.jl, the variable onGPU must be manually set to true or false. Here is how it is currently implemented:
onGPU = true # Set to false to run tests on CPU
I would like to inquire if it is possible to automate this process. Specifically, the desired behavior would be:
Check if the user has a GPU available.
If a GPU is available and onGPU is set to true, run the tests on the GPU.
If no GPU is available, automatically default to running tests on the CPU, regardless of the onGPU setting.
Additionally, we want this functionality to be available across all SpinGlass packages, including SpinGlassNetworks and SpinGlassTensors.
Currently, to run tests on either GPU or CPU using
runtests.jl
, the variable onGPU must be manually set to true or false. Here is how it is currently implemented:onGPU = true
# Set to false to run tests on CPU I would like to inquire if it is possible to automate this process. Specifically, the desired behavior would be:Additionally, we want this functionality to be available across all
SpinGlass
packages, includingSpinGlassNetworks
andSpinGlassTensors
.