summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-09-14 21:58:08 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-09-14 21:58:08 +0200
commitc21878eccee068a039f6c9567f8286c18751c69a (patch)
treeb2182fc0c3e9777b5b0886c64620045134c92eb3 /src
parent0d13d814c21f1fdb3b0781b84bf12914aec5225a (diff)
Added a guard against missing AMD and NVIDIA extensions
Diffstat (limited to 'src')
-rw-r--r--src/clpp11.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clpp11.hpp b/src/clpp11.hpp
index 86a84815..df21e110 100644
--- a/src/clpp11.hpp
+++ b/src/clpp11.hpp
@@ -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);
}