Merge pull request #98054 from demyanrogozhin/opencl-info-cl2-patch

opencl-info: fix build
This commit is contained in:
Daniël de Kok 2020-09-30 19:19:57 +02:00 committed by GitHub
commit 7a0672de18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -10,6 +10,14 @@ stdenv.mkDerivation {
sha256 = "114lxgnjg40ivjjszkv4n3f3yq2lbrvywryvbazf20kqmdz7315l";
};
patches = [
# The cl.hpp header was removed from opencl-clhpp. This patch
# updates opencl-info to use the new cp2.hpp header.
#
# Submitted upstream: https://github.com/marchv/opencl-info/pull/2
./opencl-info-clhpp2.diff
];
buildInputs = [ opencl-clhpp ocl-icd ];
NIX_LDFLAGS = "-lOpenCL";

View file

@ -0,0 +1,22 @@
diff --git a/opencl-info.cpp b/opencl-info.cpp
index a23015d..a6de0c1 100644
--- a/opencl-info.cpp
+++ b/opencl-info.cpp
@@ -7,7 +7,7 @@
#if defined(__APPLE__) || defined(__MACOSX)
# include <OpenCL/cl.hpp>
#else
-# include <CL/cl.hpp>
+# include <CL/cl2.hpp>
#endif
#include <iostream>
@@ -130,7 +130,7 @@ int main() {
PconstEnd;
P(device, CL_DEVICE_LOCAL_MEM_SIZE);
Pbool(device, CL_DEVICE_ERROR_CORRECTION_SUPPORT);
- Pbool(device, CL_DEVICE_HOST_UNIFIED_MEMORY);
+ // Pbool(device, CL_DEVICE_HOST_UNIFIED_MEMORY); /* Deprecated in 2.0 */
P(device, CL_DEVICE_PROFILING_TIMER_RESOLUTION);
Pbool(device, CL_DEVICE_ENDIAN_LITTLE);
Pbool(device, CL_DEVICE_AVAILABLE);