summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-12-05 04:20:26 +0000
committerSam James <sam@gentoo.org>2022-12-05 04:20:26 +0000
commit462ef1543682881ba43c755db473b60d4436a579 (patch)
tree78adb8f5265981f470787114b9438a162722a3a7 /dev-libs
parentdev-util/rr: fix tests w/ clang 16 (diff)
downloadgentoo-462ef1543682881ba43c755db473b60d4436a579.tar.gz
gentoo-462ef1543682881ba43c755db473b60d4436a579.tar.bz2
gentoo-462ef1543682881ba43c755db473b60d4436a579.zip
dev-libs/pocl: fix build w/ cuda
Closes: https://bugs.gentoo.org/862633 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/pocl/files/pocl-3.0-cuda.patch48
-rw-r--r--dev-libs/pocl/pocl-3.0.ebuild1
2 files changed, 49 insertions, 0 deletions
diff --git a/dev-libs/pocl/files/pocl-3.0-cuda.patch b/dev-libs/pocl/files/pocl-3.0-cuda.patch
new file mode 100644
index 000000000000..d6729b0fedce
--- /dev/null
+++ b/dev-libs/pocl/files/pocl-3.0-cuda.patch
@@ -0,0 +1,48 @@
+https://github.com/pocl/pocl/pull/1146
+
+From 978afab0ba9f90fbdb39ed4ffc52f8ca46d2bfa9 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 5 Dec 2022 04:17:05 +0000
+Subject: [PATCH] pocl-cuda: fix build with -DPOCL_DEBUG_MESSAGES=OFF
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes build failure:
+```
+/var/tmp/portage2/portage/dev-libs/pocl-3.0/work/pocl-3.0/lib/CL/devices/cuda/pocl-cuda.c: In function ‘load_or_generate_kernel’:
+/var/tmp/portage2/portage/dev-libs/pocl-3.0/work/pocl-3.0/lib/CL/devices/cuda/pocl-cuda.c:981:9: error: ‘pocl_debug_messages_filter’ undeclared (first use in this function)
+ 981 | if (!(pocl_debug_messages_filter & POCL_DEBUG_FLAG_CUDA))
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~
+```
+
+Bug: https://bugs.gentoo.org/862633
+--- a/lib/CL/devices/cuda/pocl-cuda.c
++++ b/lib/CL/devices/cuda/pocl-cuda.c
+@@ -1093,6 +1093,7 @@ load_or_generate_kernel (cl_kernel kernel, cl_device_id device,
+ /* TODO: When can we unload the module? */
+ CUmodule module;
+
++#ifdef POCL_DEBUG_MESSAGES
+ if (!(pocl_debug_messages_filter & POCL_DEBUG_FLAG_CUDA))
+ {
+ result = cuModuleLoad (&module, ptx_filename);
+@@ -1100,6 +1101,7 @@ load_or_generate_kernel (cl_kernel kernel, cl_device_id device,
+ }
+ else
+ {
++#endif
+ struct stat st;
+ stat (ptx_filename, &st);
+
+@@ -1132,7 +1134,9 @@ load_or_generate_kernel (cl_kernel kernel, cl_device_id device,
+
+ free (log);
+ free (buffer);
++#ifdef POCL_DEBUG_MESSAGES
+ }
++#endif
+
+ /* Get kernel function */
+ CUfunction function;
+
diff --git a/dev-libs/pocl/pocl-3.0.ebuild b/dev-libs/pocl/pocl-3.0.ebuild
index 51f20465bc25..7f94d77e1958 100644
--- a/dev-libs/pocl/pocl-3.0.ebuild
+++ b/dev-libs/pocl/pocl-3.0.ebuild
@@ -47,6 +47,7 @@ BDEPEND="${CLANG_DEPS}
PATCHES=(
"${FILESDIR}"/${P}-icd.patch
"${FILESDIR}"/${P}-fix-version.patch
+ "${FILESDIR}"/${P}-cuda.patch
)
python_check_deps() {