From 3648d360c64e660acb6c90bedc09d310a88bf0b4 Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" Date: Sun, 5 Aug 2018 22:21:20 +0100 Subject: [PATCH 1/4] Disable scan use_bank_conflict_avoidance on Intel, as it crashes --- pyopencl/scan.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyopencl/scan.py b/pyopencl/scan.py index d4226cf6..c17acb2c 100644 --- a/pyopencl/scan.py +++ b/pyopencl/scan.py @@ -1227,8 +1227,12 @@ class GenericScanKernel(_GenericScanKernelBase): max_scan_wg_size = min(dev.max_work_group_size for dev in self.devices) wg_size_multiples = 64 + # Intel beignet asserts or gives wrong results with packed structs + # https://bugs.freedesktop.org/show_bug.cgi?id=98717 + # TODO: is this all Intel ICDs or only beignet? use_bank_conflict_avoidance = ( - self.dtype.itemsize > 4 and self.dtype.itemsize % 8 == 0 and is_gpu) + self.dtype.itemsize > 4 and self.dtype.itemsize % 8 == 0 + and is_gpu and "Intel" not in self.devices[0].platform.name) # k_group_size should be a power of two because of in-kernel # division by that number. -- GitLab From 6a9b444aa5dae952e1632919e75aba3fed0cad2b Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" Date: Sun, 5 Aug 2018 22:22:20 +0100 Subject: [PATCH 2/4] Skip tests not supported by the current hardware --- test/test_clrandom.py | 3 +++ test/test_wrapper.py | 1 + 2 files changed, 4 insertions(+) diff --git a/test/test_clrandom.py b/test/test_clrandom.py index 2846e24c..0cd572d0 100644 --- a/test/test_clrandom.py +++ b/test/test_clrandom.py @@ -31,6 +31,7 @@ import pyopencl.clrandom as clrandom from pyopencl.tools import ( # noqa pytest_generate_tests_for_pyopencl as pytest_generate_tests) +from pyopencl.characterize import has_double_support try: import faulthandler @@ -59,6 +60,8 @@ def make_ranlux_generator(cl_ctx): cltypes.float4]) def test_clrandom_dtypes(ctx_factory, rng_class, dtype): cl_ctx = ctx_factory() + if dtype == np.float64 and not has_double_support(cl_ctx.devices[0]): + pytest.skip("double precision not supported on this device") rng = rng_class(cl_ctx) size = 10 diff --git a/test/test_wrapper.py b/test/test_wrapper.py index 118eee74..a17866fa 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -953,6 +953,7 @@ def test_coarse_grain_svm(ctx_factory): dev = ctx.devices[0] has_svm = (ctx._get_cl_version() >= (2, 0) and + ctx.devices[0]._get_cl_version() >= (2, 0) and cl.get_cl_header_version() >= (2, 0)) if dev.platform.name == "Portable Computing Language": -- GitLab From 72bde322d0b3bdb0525a30ee3d82925ca5752986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Sun, 5 Aug 2018 19:31:24 -0400 Subject: [PATCH 3/4] Force use of gcc for Conda Apple CI --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e37c40b5..0047755f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -166,6 +166,7 @@ Python 2.7 Apple: Python 3 Conda Apple: script: - CONDA_ENVIRONMENT=.test-conda-env-py3.yml + - export CC=gcc - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh - ". ./build-and-test-py-project-within-miniconda.sh" tags: -- GitLab From 5a2c1af2387c35dd5dd6ce39ce3d339ef2504efb Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" Date: Sat, 11 Aug 2018 17:16:11 +0100 Subject: [PATCH 4/4] Disable use_bank_conflict_avoidance only on beignet, improve comment --- pyopencl/scan.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pyopencl/scan.py b/pyopencl/scan.py index c17acb2c..ab8aee30 100644 --- a/pyopencl/scan.py +++ b/pyopencl/scan.py @@ -1227,12 +1227,17 @@ class GenericScanKernel(_GenericScanKernelBase): max_scan_wg_size = min(dev.max_work_group_size for dev in self.devices) wg_size_multiples = 64 - # Intel beignet asserts or gives wrong results with packed structs + # Intel beignet fails "Out of shared local memory" in test_scan int64 + # and asserts in test_sort with this enabled: + # https://github.com/inducer/pyopencl/pull/238 + # A beignet bug report (outside of pyopencl) suggests packed structs + # (which this is) can even give wrong results: # https://bugs.freedesktop.org/show_bug.cgi?id=98717 - # TODO: is this all Intel ICDs or only beignet? + # TODO: does this also affect Intel Compute Runtime? use_bank_conflict_avoidance = ( self.dtype.itemsize > 4 and self.dtype.itemsize % 8 == 0 - and is_gpu and "Intel" not in self.devices[0].platform.name) + and is_gpu + and "beignet" not in self.devices[0].platform.version.lower()) # k_group_size should be a power of two because of in-kernel # division by that number. -- GitLab