aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-02-19 22:16:40 +0100
committerMichael Bien <[email protected]>2010-02-19 22:16:40 +0100
commited40efbf71daaee371d7eb334b0b7a00919548bc (patch)
tree986ae5fad1b2b82fd898f9da4aec9abd39bfbb09 /src
parenta49b22397ae525e9b659a112aa11e4647c18c214 (diff)
fixed CLBufferTest.mapBufferTest() for non CPU contexts.
Diffstat (limited to 'src')
-rw-r--r--src/com/mbien/opencl/CLPlatform.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLPlatform.java b/src/com/mbien/opencl/CLPlatform.java
index 2f3cbf54..c3b1a1f2 100644
--- a/src/com/mbien/opencl/CLPlatform.java
+++ b/src/com/mbien/opencl/CLPlatform.java
@@ -98,6 +98,12 @@ public final class CLPlatform {
//find all devices
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) {
+ return new CLDevice[0];
+ }
+
checkForError(ret, "error while enumerating devices");
PointerBuffer deviceIDs = PointerBuffer.allocateDirect(ib.get(0));