From 4a5c868a1537dddbfbd665182c8a319a8eab14e2 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt <stefan@sun.ac.za> Date: Sat, 3 Jul 2010 12:46:53 -0500 Subject: [PATCH] In arrays, check platform maximum work group size. --- pyopencl/array.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyopencl/array.py b/pyopencl/array.py index 474a6bc7..c0c74ef6 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -37,8 +37,9 @@ import pyopencl as cl def splay(ctx, n): - min_work_items = 32 - max_work_items = 128 + max_work_items = max(dev.max_work_group_size for dev in ctx.devices) + max_work_items = min(128, max_work_items) + min_work_items = min(32, max_work_items) max_groups = max( 4 * dev.max_compute_units * 8 # 4 to overfill the device -- GitLab