Only check for GPU double precision support if a GPU is present

This commit is contained in:
Richard Berger
2021-10-18 12:15:05 -04:00
committed by Axel Kohlmeyer
parent 8999b1f69f
commit 4675a3b560

View File

@ -1047,7 +1047,7 @@ bool lmp_has_compatible_gpu_device()
UCL_Device gpu;
bool compatible_gpu = gpu.num_platforms() > 0;
#if defined(_SINGLE_DOUBLE) || defined(_DOUBLE_DOUBLE)
if (!gpu.double_precision(0))
if (compatible_gpu && !gpu.double_precision(0))
compatible_gpu = false;
#endif
return compatible_gpu;