Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/ocl-icd/files/, dev-libs/ocl-icd/
Date: Sat, 29 May 2021 14:44:03
Message-Id: 1622299412.d19af2426ace8a0bbc48ee64c042ef15a18f29ea.chewi@gentoo
1 commit: d19af2426ace8a0bbc48ee64c042ef15a18f29ea
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 29 14:41:28 2021 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat May 29 14:43:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d19af242
7
8 dev-libs/ocl-icd: Version bump to 2.3.0
9
10 This is compatible with the new OpenCL headers.
11
12 Closes: https://bugs.gentoo.org/789558
13 Package-Manager: Portage-3.0.19, Repoman-3.0.3
14 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
15
16 dev-libs/ocl-icd/Manifest | 1 +
17 .../ocl-icd/files/ocl-icd-2.3.0-new-headers.patch | 94 ++++++++++++++++++++++
18 dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild | 61 ++++++++++++++
19 3 files changed, 156 insertions(+)
20
21 diff --git a/dev-libs/ocl-icd/Manifest b/dev-libs/ocl-icd/Manifest
22 index 8b60ba9e2d3..50148b96627 100644
23 --- a/dev-libs/ocl-icd/Manifest
24 +++ b/dev-libs/ocl-icd/Manifest
25 @@ -1,2 +1,3 @@
26 DIST ocl-icd-2.2.12.tar.gz 80718 BLAKE2B 524f9eea9782323eafa2f41858c4970333c029898c651bbf15624331e184d1b439d2259532b02defd67c9ab434a35b1b9a64a28e1515b3f42f09b3a270975df7 SHA512 f1668c3a39ecfbc089ee5a5f61f44ceb86ab80e504e58064dec306ce907daf77936c5403b4af15ed8714068891d68346c86725f285cfbc90c4fcb35d18db4048
27 DIST ocl-icd-2.2.14.tar.gz 100629 BLAKE2B 4862560541c979edb06d89f7f57b78a34c02e38843c02b0f125a121649cd6a33570e29c86fe7d3fd6f0fa3d489831777100daef97264e32b82854384075cbbf2 SHA512 78510b6fa4e2c6a52141a51ccf0d0ef3110b0b4902a43bb97f7622ff0ce470b108dc05c9619c28ce8758ccea1e1cf6b2e7f1a296f8b07f52532f23b2b036a5cf
28 +DIST ocl-icd-2.3.0.tar.gz 100848 BLAKE2B b9e5b78df63f4865bb4cb3623fbc6bd336c86b4a9e1f23a29fab1cf11f848cb20d6d8d4a480ff44e442b02d606247a923798143058256ef59c2b16c9daf7098d SHA512 003f3661b7086a7364e79d1058591f12a7095aa2c3decfc4b496f00a0863a91cd81080f33b9308e3948045f8aca5856868ed2725f478654230e51a60d654e613
29
30 diff --git a/dev-libs/ocl-icd/files/ocl-icd-2.3.0-new-headers.patch b/dev-libs/ocl-icd/files/ocl-icd-2.3.0-new-headers.patch
31 new file mode 100644
32 index 00000000000..aa35c96ccda
33 --- /dev/null
34 +++ b/dev-libs/ocl-icd/files/ocl-icd-2.3.0-new-headers.patch
35 @@ -0,0 +1,94 @@
36 +From aed1832c81c0971ea001e12d41e04df834257f94 Mon Sep 17 00:00:00 2001
37 +From: Brice Videau <bvideau@×××.gov>
38 +Date: Wed, 12 May 2021 10:24:44 -0500
39 +Subject: [PATCH] Updated to support latest Khronos headers.
40 +
41 +---
42 + icd_generator.rb | 4 +-
43 + khronos-headers/CL/cl.h | 46 +--
44 + khronos-headers/CL/cl_d3d10.h | 12 +-
45 + khronos-headers/CL/cl_d3d11.h | 12 +-
46 + khronos-headers/CL/cl_dx9_media_sharing.h | 32 +-
47 + khronos-headers/CL/cl_egl.h | 8 +-
48 + khronos-headers/CL/cl_ext.h | 228 +++++++++----
49 + khronos-headers/CL/cl_gl.h | 22 +-
50 + khronos-headers/CL/cl_gl_ext.h | 26 +-
51 + khronos-headers/CL/cl_icd.h | 316 +++++++++---------
52 + khronos-headers/CL/cl_layer.h | 4 +-
53 + khronos-headers/CL/cl_platform.h | 125 ++++---
54 + .../CL/cl_va_api_media_sharing_intel.h | 24 +-
55 + khronos-headers/CL/opencl.h | 3 +-
56 + ocl_interface.yaml | 10 +-
57 + run_dummy_icd.c | 1 -
58 + 16 files changed, 484 insertions(+), 389 deletions(-)
59 +
60 +diff --git a/icd_generator.rb b/icd_generator.rb
61 +index bb0f2e9..ed4217f 100644
62 +--- a/icd_generator.rb
63 ++++ b/icd_generator.rb
64 +@@ -57,7 +57,7 @@ module IcdGenerator
65 + "clGetGLContextInfoKHR", "clUnloadCompiler",
66 + "clCreateContext", "clCreateContextFromType", "clWaitForEvents"]
67 + $header_files = ["/usr/include/CL/cl.h", "/usr/include/CL/cl_gl.h", "/usr/include/CL/cl_egl.h",
68 +- "/usr/include/CL/cl_ext.h", "/usr/include/CL/cl_gl_ext.h"]
69 ++ "/usr/include/CL/cl_ext.h"]
70 + $windows_header_files = ["/usr/include/CL/cl_dx9_media_sharing.h", "/usr/include/CL/cl_d3d11.h", "/usr/include/CL/cl_d3d10.h"]
71 + $cl_data_type_error = { "cl_platform_id" => "CL_INVALID_PLATFORM",
72 + "cl_device_id" => "CL_INVALID_DEVICE",
73 +@@ -246,7 +246,7 @@ def self.generate_run_dummy_icd_source
74 + run_dummy_icd += "\n\n"
75 + $api_entries.each_key { |func_name|
76 + next if $forbidden_funcs.include?(func_name)
77 +- run_dummy_icd += $api_entries[func_name]+";\n"
78 ++ run_dummy_icd += $api_entries[func_name]+"\n"
79 + }
80 + run_dummy_icd += "\n\n"
81 + run_dummy_icd += "void call_all_OpenCL_functions(cl_platform_id chosen_platform) {\n"
82 +diff --git a/ocl_interface.yaml b/ocl_interface.yaml
83 +index 1e80f16..43a0e59 100644
84 +--- a/ocl_interface.yaml
85 ++++ b/ocl_interface.yaml
86 +@@ -674,18 +674,18 @@
87 + const cl_device_partition_property_ext * /* properties */,
88 + cl_uint /*num_entries*/,
89 + cl_device_id * /*out_devices*/,
90 +- cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
91 ++ cl_uint * /*num_devices*/ ) CL_API_SUFFIX__VERSION_1_1;
92 + 90: |-
93 + CL_API_ENTRY cl_int CL_API_CALL
94 +- clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
95 ++ clRetainDeviceEXT( cl_device_id /*device*/ ) CL_API_SUFFIX__VERSION_1_1;
96 + 91: |-
97 + CL_API_ENTRY cl_int CL_API_CALL
98 +- clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
99 ++ clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_API_SUFFIX__VERSION_1_1;
100 + 92: |-
101 + CL_API_ENTRY cl_event CL_API_CALL
102 + clCreateEventFromGLsyncKHR(cl_context /* context */,
103 + cl_GLsync /* cl_GLsync */,
104 +- cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1;
105 ++ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
106 + 93: |-
107 + CL_API_ENTRY cl_int CL_API_CALL
108 + clCreateSubDevices(cl_device_id /* in_device */,
109 +@@ -1016,7 +1016,7 @@
110 + const void * /*input_value*/,
111 + size_t /*param_value_size*/,
112 + void* /*param_value*/,
113 +- size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
114 ++ size_t* /*param_value_size_ret*/ ) CL_API_SUFFIX__VERSION_2_0;
115 + 137: |-
116 + CL_API_ENTRY cl_kernel CL_API_CALL
117 + clCloneKernel(cl_kernel /* source_kernel */,
118 +diff --git a/run_dummy_icd.c b/run_dummy_icd.c
119 +index 400c1b0..c064b19 100644
120 +--- a/run_dummy_icd.c
121 ++++ b/run_dummy_icd.c
122 +@@ -39,7 +39,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
123 + # include <CL/cl_gl.h>
124 + # include <CL/cl_egl.h>
125 + # include <CL/cl_ext.h>
126 +-# include <CL/cl_gl_ext.h>
127 + #pragma GCC diagnostic pop
128 + #include <string.h>
129 + #include "ocl_icd_debug.h"
130
131 diff --git a/dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild b/dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild
132 new file mode 100644
133 index 00000000000..3a274d0c168
134 --- /dev/null
135 +++ b/dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild
136 @@ -0,0 +1,61 @@
137 +# Copyright 1999-2021 Gentoo Authors
138 +# Distributed under the terms of the GNU General Public License v2
139 +
140 +EAPI=7
141 +
142 +USE_RUBY="ruby25 ruby26 ruby27 ruby30"
143 +inherit autotools flag-o-matic multilib-minimal ruby-single
144 +
145 +DESCRIPTION="Alternative to vendor specific OpenCL ICD loaders"
146 +HOMEPAGE="https://github.com/OCL-dev/ocl-icd"
147 +SRC_URI="https://github.com/OCL-dev/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
148 +LICENSE="BSD-2"
149 +SLOT="0"
150 +KEYWORDS="~amd64 ~x86"
151 +
152 +# Does nothing now but by keeping it here we avoid having to have virtual/opencl
153 +# handle ebuilds both with and without this flag.
154 +IUSE="+khronos-headers"
155 +
156 +BDEPEND="${RUBY_DEPS}"
157 +DEPEND=">=dev-util/opencl-headers-2021.04.29"
158 +RDEPEND="${DEPEND}
159 + !app-eselect/eselect-opencl
160 + !dev-libs/opencl-icd-loader"
161 +
162 +PATCHES=(
163 + "${FILESDIR}"/${P}-new-headers.patch
164 +)
165 +
166 +src_prepare() {
167 + replace-flags -Os -O2 # bug 646122
168 +
169 + default
170 + eautoreconf
171 +}
172 +
173 +multilib_src_configure() {
174 + # dev-util/opencl-headers ARE official Khronos Group headers, what this option
175 + # does is disable the use of the bundled ones
176 + ECONF_SOURCE="${S}" econf --enable-pthread-once --disable-official-khronos-headers
177 +}
178 +
179 +multilib_src_compile() {
180 + local candidates=(${USE_RUBY})
181 + local ruby=
182 + for (( idx=${#candidates[@]}-1 ; idx>=0 ; idx-- )) ; do
183 + if ${candidates[idx]} --version &> /dev/null; then
184 + ruby=${candidates[idx]} && break
185 + fi
186 + done
187 + [[ -z ${ruby} ]] && die "No ruby executable found"
188 +
189 + emake RUBY=${ruby}
190 +}
191 +
192 +multilib_src_install() {
193 + default
194 +
195 + # Drop .la files
196 + find "${ED}" -name '*.la' -delete || die
197 +}