Fix: Add missing ifdef guards for OIDN GPU devices

It is not guaranteed that the GPU variables will be available depending
on the current OIDN configuration
This commit is contained in:
Sebastian Parborg
2024-03-06 19:17:10 +01:00
parent b4f1d15af6
commit ebb781675d

View File

@@ -35,14 +35,22 @@ static const char *oidn_device_type_to_string(const OIDNDeviceType type)
return "DEFAULT";
case OIDN_DEVICE_TYPE_CPU:
return "CPU";
# ifdef OIDN_DEVICE_SYCL
case OIDN_DEVICE_TYPE_SYCL:
return "SYCL";
# endif
# ifdef OIDN_DEVICE_CUDA
case OIDN_DEVICE_TYPE_CUDA:
return "CUDA";
# endif
# ifdef OIDN_DEVICE_HIP
case OIDN_DEVICE_TYPE_HIP:
return "HIP";
# endif
# ifdef OIDN_DEVICE_METAL
case OIDN_DEVICE_TYPE_METAL:
return "METAL";
# endif
}
return "UNKNOWN";
}