aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/clImplCustomCode20.java
diff options
context:
space:
mode:
Diffstat (limited to 'make/config/clImplCustomCode20.java')
-rw-r--r--make/config/clImplCustomCode20.java54
1 files changed, 3 insertions, 51 deletions
diff --git a/make/config/clImplCustomCode20.java b/make/config/clImplCustomCode20.java
index e6c8071c..6247dd6c 100644
--- a/make/config/clImplCustomCode20.java
+++ b/make/config/clImplCustomCode20.java
@@ -1,60 +1,12 @@
- /** If null, OpenCL is not available on this machine. */
- static final DynamicLibraryBundle dynamicLookupHelper;
protected static final CLProcAddressTable20 addressTable;
static {
addressTable = new CLProcAddressTable20();
- dynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
- public DynamicLibraryBundle run() {
- final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new CLDynamicLibraryBundleInfo());
- if(!bundle.isToolLibLoaded()) {
- // couldn't load native CL library
- // TODO: log this?
- return null;
- }
- if(!bundle.isLibComplete()) {
- System.err.println("Couln't load native CL/JNI glue library");
- return null;
- }
- addressTable.reset(bundle);
- /** Not required nor forced
- if( !initializeImpl() ) {
- System.err.println("Native initialization failure of CL/JNI glue library");
- return null;
- } */
- return bundle;
- } } );
}
- /**
- * Accessor.
- * @returns true if OpenCL is available on this machine.
- */
- public static boolean isAvailable() { return dynamicLookupHelper != null; }
- public static CLProcAddressTable20 getCLProcAddressTable() { return addressTable; }
+ public static CLProcAddressTable20 getAddressTable() { return addressTable; }
- static long clGetExtensionFunctionAddress(long clGetExtensionFunctionAddressHandle, java.lang.String procname)
- {
- if (clGetExtensionFunctionAddressHandle == 0) {
- throw new RuntimeException("Passed null pointer for method \"clGetExtensionFunctionAddress\"");
- }
- return dispatch_clGetExtensionFunctionAddressStatic(procname, clGetExtensionFunctionAddressHandle);
+ public CLImpl20() {
+ init();
}
-
- public CLAbstractImpl20() {
- }
-
- /** Entry point (through function pointer) to C language function: <br> <code> void* clGetExtensionFunctionAddress(const char * fname); </code> */
- long clGetExtensionFunctionAddress(String fname) {
-
- final long __addr_ = addressTable._addressof_clGetExtensionFunctionAddress;
- if (__addr_ == 0) {
- throw new UnsupportedOperationException("Method \"clGetExtensionFunctionAddress\" not available");
- }
- return dispatch_clGetExtensionFunctionAddressStatic(fname, __addr_);
- }
-
- /** Entry point (through function pointer) to C language function: <br> <code> void* clGetExtensionFunctionAddress(const char * fname); </code> */
- private static native long dispatch_clGetExtensionFunctionAddressStatic(String fname, long procAddress);
-