Added a guard against missing AMD and NVIDIA extensions

pull/191/head
Cedric Nugteren 2017-09-14 21:58:08 +02:00
parent 0d13d814c2
commit c21878ecce
1 changed files with 9 additions and 0 deletions

View File

@ -313,9 +313,18 @@ class Device {
// Platform specific extensions
std::string AMDBoardName() const { // check for 'cl_amd_device_attribute_query' first
#ifndef CL_DEVICE_BOARD_NAME_AMD
#define CL_DEVICE_BOARD_NAME_AMD 0x4038
#endif
return GetInfoString(CL_DEVICE_BOARD_NAME_AMD);
}
std::string NVIDIAComputeCapability() const { // check for 'cl_nv_device_attribute_query' first
#ifndef CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV
#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
#endif
#ifndef CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV
#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
#endif
return std::string{"SM"} + GetInfoString(CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV) +
std::string{"."} + GetInfoString(CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV);
}