From 3c3c59f0af028d3464e096c4861a872e1002adb6 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sat, 22 Jan 2011 04:55:05 +0100 Subject: check for empty device list to prevent a INVALID_VALUE exception on apple's impl. --- src/com/jogamp/opencl/CLPlatform.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/jogamp/opencl') diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java index 323022e4..6658f006 100644 --- a/src/com/jogamp/opencl/CLPlatform.java +++ b/src/com/jogamp/opencl/CLPlatform.java @@ -268,7 +268,7 @@ public final class CLPlatform { int ret = cl.clGetDeviceIDs(ID, type.TYPE, 0, null, ib); // return an empty array rather than throwing an exception - if(ret == CL.CL_DEVICE_NOT_FOUND) { + if(ret == CL.CL_DEVICE_NOT_FOUND || ib.get(0) == 0) { continue; } -- cgit v1.2.3