diff --git a/0001-Add_CL_DEVICE_BOARD_NAME_AMD.patch b/0001-Add_CL_DEVICE_BOARD_NAME_AMD.patch new file mode 100644 index 0000000..a50aa33 --- /dev/null +++ b/0001-Add_CL_DEVICE_BOARD_NAME_AMD.patch @@ -0,0 +1,26 @@ +From faa9f15b88b99ec5284d2285f0a70715ecfe68d2 Mon Sep 17 00:00:00 2001 +From: greatpanc +Date: Mon, 22 Nov 2021 21:52:59 +0800 +Subject: [PATCH] Add_CL_DEVICE_BOARD_NAME_AMD + +--- + include/CL/cl2.hpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp +index ced4b03..6207f52 100644 +--- OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp ++++ OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp +@@ -1498,6 +1498,9 @@ CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUT + #ifdef CL_DEVICE_LOCAL_MEM_BANKS_AMD + CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LOCAL_MEM_BANKS_AMD, cl_uint) + #endif ++#ifdef CL_DEVICE_BOARD_NAME_AMD ++ CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_BOARD_NAME_AMD, string) ++#endif + + #ifdef CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM + CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM, cl_ulong) +-- +2.25.1 + diff --git a/0002-add-missing-const-to-context-properties.patch b/0002-add-missing-const-to-context-properties.patch new file mode 100644 index 0000000..761ab86 --- /dev/null +++ b/0002-add-missing-const-to-context-properties.patch @@ -0,0 +1,43 @@ +From ef63c6265000ab89d5657e1d2e020e7c7de33d7e Mon Sep 17 00:00:00 2001 +From: greatpanc +Date: Tue, 23 Nov 2021 15:34:59 +0800 +Subject: [PATCH] add missing const to context properties + +--- + include/CL/cl2.hpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp +index ced4b03..24da723 100644 +--- OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp ++++ OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp +@@ -2806,7 +2806,7 @@ public: + */ + Context( + const vector& devices, +- cl_context_properties* properties = NULL, ++ const cl_context_properties* properties = NULL, + void (CL_CALLBACK * notifyFptr)( + const char *, + const void *, +@@ -2837,7 +2837,7 @@ public: + + Context( + const Device& device, +- cl_context_properties* properties = NULL, ++ const cl_context_properties* properties = NULL, + void (CL_CALLBACK * notifyFptr)( + const char *, + const void *, +@@ -2867,7 +2867,7 @@ public: + */ + Context( + cl_device_type type, +- cl_context_properties* properties = NULL, ++ const cl_context_properties* properties = NULL, + void (CL_CALLBACK * notifyFptr)( + const char *, + const void *, +-- +2.25.1 + diff --git a/0003-Fix-cl-enqueueMapSVM-for-cl-vector-and-cl-pointer.patch b/0003-Fix-cl-enqueueMapSVM-for-cl-vector-and-cl-pointer.patch new file mode 100644 index 0000000..04d095c --- /dev/null +++ b/0003-Fix-cl-enqueueMapSVM-for-cl-vector-and-cl-pointer.patch @@ -0,0 +1,34 @@ +From 5b388814ca0f51ccc78c3aef41f824e139f06df4 Mon Sep 17 00:00:00 2001 +From: greatpanc +Date: Tue, 23 Nov 2021 16:01:57 +0800 +Subject: [PATCH] Fix cl::enqueueMapSVM for cl::vector and cl::pointer + +--- + include/CL/cl2.hpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp +index ced4b03..d4bb695 100644 +--- OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp ++++ OpenCL-CLHPP-2.0.12/include/CL/cl2.hpp +@@ -9220,7 +9220,7 @@ inline cl_int enqueueMapSVM( + */ + template + inline cl_int enqueueMapSVM( +- cl::pointer ptr, ++ cl::pointer &ptr, + cl_bool blocking, + cl_map_flags flags, + size_type size, +@@ -9244,7 +9244,7 @@ inline cl_int enqueueMapSVM( + */ + template + inline cl_int enqueueMapSVM( +- cl::vector container, ++ cl::vector &container, + cl_bool blocking, + cl_map_flags flags, + const vector* events = NULL, +-- +2.25.1 + diff --git a/opencl-clhpp.spec b/opencl-clhpp.spec index 046f3c2..f3d4815 100644 --- a/opencl-clhpp.spec +++ b/opencl-clhpp.spec @@ -1,9 +1,9 @@ %global date 2020.12.18 Name: opencl-clhpp Version: 2.0.12 -Release: 8 +Release: 9 Summary: OpenCL (Open Computing Language) bind cpp header files. -License: Apache-2.0 MIT +License: Apache-2.0 and MIT URL: https://github.com/KhronosGroup/OpenCL-CLHPP Source0: https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v%{version}.tar.gz Source1: https://github.com/KhronosGroup/OpenCL-Headers/archive/v%{date}.tar.gz @@ -11,6 +11,10 @@ Source2: https://github.com/ThrowTheSwitch/CMock/archive/refs/tags/v Source3: https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.5.2.tar.gz Source4: https://github.com/ThrowTheSwitch/CException/archive/refs/tags/v1.3.3.tar.gz +Patch1: 0001-Add_CL_DEVICE_BOARD_NAME_AMD.patch +Patch2: 0002-add-missing-const-to-context-properties.patch +Patch3: 0003-Fix-cl-enqueueMapSVM-for-cl-vector-and-cl-pointer.patch + BuildArch: noarch BuildRequires: gcc-c++ cmake >= 3.14.0 ocl-icd rubygems ruby python git @@ -21,7 +25,7 @@ Provides: bundled(grpc) %{summary}. %prep -%autosetup -n OpenCL-CLHPP-%{version} +tar -zxf %SOURCE0 -C %{_builddir}/ tar -zxf %SOURCE1 -C %{_builddir}/OpenCL-CLHPP-%{version} tar -zxf %SOURCE2 -C %{_builddir}/OpenCL-CLHPP-%{version}/external/ tar -zxf %SOURCE3 -C %{_builddir}/OpenCL-CLHPP-%{version}/external/ @@ -31,12 +35,9 @@ tar -zxf %SOURCE4 -C %{_builddir}/OpenCL-CLHPP-%{version}/external/CMock/vendor/ mv %{_builddir}/OpenCL-CLHPP-%{version}/external/CMock/vendor/Unity/* %{_builddir}/OpenCL-CLHPP-%{version}/external/CMock/vendor/unity/ %build +cd %{_builddir}/OpenCL-CLHPP-%{version} ln -s /usr/lib64/libOpenCL.so.1 %{_builddir}/OpenCL-CLHPP-%{version}/libOpenCL.so -git apply 0001-Add_CL_DEVICE_BOARD_NAME_AMD.patch -git apply 0002-add-missing-const-to-context-properties.patch -git apply 0003-Fix-cl-enqueueMapSVM-for-cl-vector-and-cl-pointer.patch - rm -rf build mkdir build cd build @@ -47,10 +48,12 @@ cmake .. -DOPENCL_INCLUDE_DIR=%{_builddir}/OpenCL-CLHPP-%{version}/OpenCL-Header -DBUILD_EXAMPLES=ON %install +cd %{_builddir}/OpenCL-CLHPP-%{version} cd build make install DESTDIR=%{buildroot} %check +cd %{_builddir}/OpenCL-CLHPP-%{version} cd build make test @@ -59,6 +62,9 @@ make test /usr/local/include/CL/cl2.hpp %changelog +* Tue Nov 12 2021 yinchangpan - v2.12.0-9 +- remove patch + * Tue Nov 12 2021 yinchangpan - v2.12.0-8 - patch 0003-Fix-cl-enqueueMapSVM-for-cl-vector-and-cl-pointer.patch diff --git a/v2.0.12.tar.gz b/v2.0.12.tar.gz index 2f26c13..b5219b6 100644 Binary files a/v2.0.12.tar.gz and b/v2.0.12.tar.gz differ