Skip to content

Commit

Permalink
check for empty device list to prevent a INVALID_VALUE exception on a…
Browse files Browse the repository at this point in the history
…pple's impl.
  • Loading branch information
mbien committed Jan 22, 2011
1 parent 5941ad8 commit 3c3c59f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/jogamp/opencl/CLPlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public CLDevice[] listCLDevices(CLDevice.Type... types) {
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;
}

Expand Down

0 comments on commit 3c3c59f

Please sign in to comment.