summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp
diff options
context:
space:
mode:
authorXavier Hallade <[email protected]>2015-01-09 11:37:13 +0100
committerXavier Hallade <[email protected]>2015-01-09 11:37:13 +0100
commit0f1ed8774549d51b45ade69e8883dcd5565951b2 (patch)
tree18df95ca46b6f4d9517793b9c877a16530248ed4 /src/com/jogamp
parenta1108d2f560192df7fcd9a554c43e165ff8d171b (diff)
added workaround to list devices in case platform only supports CL_DEVICE_TYPE_GPU (and not CL_DEVICE_TYPE_ALL).
That's the case with PowerVR OpenCL driver on Android devices.
Diffstat (limited to 'src/com/jogamp')
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index d63f6708..26cdbc8a 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -271,7 +271,12 @@ public class CLPlatform {
* @see #listCLDevices(com.jogamp.opencl.CLDevice.Type...)
*/
public CLDevice[] listCLDevices() {
- return this.listCLDevices(CLDevice.Type.ALL);
+ try{
+ return this.listCLDevices(CLDevice.Type.ALL);
+ }
+ catch(CLInvalidDeviceTypeException ignore){ //trying to list GPUs if CL_DEVICE_TYPE_ALL isn't valid. on some non-standard implementations (Android PowerVR), only CL_DEVICE_TYPE_GPU is supported and use of other types including ALL will lead to a CL_INVALID_DEVICE_TYPE
+ return this.listCLDevices(CLDevice.Type.GPU);
+ }
}
/**