summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp')
-rw-r--r--src/com/jogamp/opencl/CLCommandQueue.java3
-rw-r--r--src/com/jogamp/opencl/CLEventList.java4
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java7
-rw-r--r--src/com/jogamp/opencl/CLProgram.java5
-rw-r--r--src/com/jogamp/opencl/impl/CLTLAccessorFactory.java4
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java2
6 files changed, 18 insertions, 7 deletions
diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java
index f95576b6..7e78be4a 100644
--- a/src/com/jogamp/opencl/CLCommandQueue.java
+++ b/src/com/jogamp/opencl/CLCommandQueue.java
@@ -43,6 +43,7 @@ import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
+import com.jogamp.common.nio.AbstractBuffer;
import com.jogamp.common.nio.CachedBufferFactory;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.gl.CLGLObject;
@@ -82,7 +83,7 @@ public class CLCommandQueue extends CLObjectResource {
this.properties = properties;
this.cl = context.getPlatform().getCLBinding();
- final int pbsize = PointerBuffer.ELEMENT_SIZE;
+ final int pbsize = AbstractBuffer.POINTER_SIZE;
final CachedBufferFactory factory = CachedBufferFactory.create(9*pbsize + 4, true);
this.ibA = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java
index 806a0661..f890558a 100644
--- a/src/com/jogamp/opencl/CLEventList.java
+++ b/src/com/jogamp/opencl/CLEventList.java
@@ -28,6 +28,7 @@
package com.jogamp.opencl;
+import com.jogamp.common.nio.AbstractBuffer;
import com.jogamp.common.nio.CachedBufferFactory;
import com.jogamp.common.nio.PointerBuffer;
import java.util.Iterator;
@@ -85,7 +86,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
if(factory == null) {
return PointerBuffer.allocateDirect(size);
}else{
- return PointerBuffer.wrap(factory.newDirectByteBuffer(size*PointerBuffer.ELEMENT_SIZE));
+ return PointerBuffer.wrap(factory.newDirectByteBuffer(size*AbstractBuffer.POINTER_SIZE));
}
}
@@ -175,6 +176,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
return events.length;
}
+ @Override
public boolean isReleased() {
return size == 0;
}
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index 34265465..f64df614 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -281,7 +281,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);
+ }
}
/**
diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java
index 3c68fa35..401c547a 100644
--- a/src/com/jogamp/opencl/CLProgram.java
+++ b/src/com/jogamp/opencl/CLProgram.java
@@ -28,6 +28,7 @@
package com.jogamp.opencl;
+import com.jogamp.common.nio.AbstractBuffer;
import com.jogamp.common.nio.CachedBufferFactory;
import com.jogamp.opencl.util.CLProgramConfiguration;
import com.jogamp.opencl.util.CLUtil;
@@ -109,7 +110,7 @@ public class CLProgram extends CLObjectResource {
binarySize += entry.getValue().length;
}
- final int pbSize = PointerBuffer.ELEMENT_SIZE;
+ final int pbSize = AbstractBuffer.POINTER_SIZE;
final int deviceCount = binaries.size();
final CachedBufferFactory bf = CachedBufferFactory.create(binarySize + pbSize*deviceCount*3 + 4, true);
@@ -373,7 +374,7 @@ public class CLProgram extends CLObjectResource {
{
try {
buildLock.acquire();
- } catch(InterruptedException e) {
+ } catch(final InterruptedException e) {
throw newException(ret, "\nInterrupted while waiting to get build lock");
}
diff --git a/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java b/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java
index 7195d592..b32636bf 100644
--- a/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java
+++ b/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java
@@ -33,6 +33,8 @@
package com.jogamp.opencl.impl;
import java.nio.IntBuffer;
+
+import com.jogamp.common.nio.AbstractBuffer;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.CL;
import com.jogamp.opencl.spi.CLAccessorFactory;
@@ -103,7 +105,7 @@ public class CLTLAccessorFactory implements CLAccessorFactory {
}else{
checkForError(ret, "error while enumerating devices");
- final PointerBuffer deviceIDs = PointerBuffer.wrap(getBB(count*PointerBuffer.ELEMENT_SIZE));
+ final PointerBuffer deviceIDs = PointerBuffer.wrap(getBB(count*AbstractBuffer.POINTER_SIZE));
ret = cl.clGetDeviceIDs(ID, type, count, deviceIDs, null);
checkForError(ret, "error while enumerating devices");
diff --git a/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java b/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java
index b48cb47c..39365a23 100644
--- a/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java
+++ b/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java
@@ -50,7 +50,7 @@ public final class CLDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
public Object run() {
Platform.initSingleton();
- if( TempJarCache.isInitialized() ) {
+ if( TempJarCache.isInitialized(true) ) {
// only: jocl.jar -> jocl-natives-<os.and.arch>.jar
JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { jogamp.opencl.Debug.class }, null );
}