diff options
author | Wade Walker <[email protected]> | 2015-09-12 14:28:16 -0500 |
---|---|---|
committer | Wade Walker <[email protected]> | 2015-11-08 14:05:29 -0600 |
commit | 9a90181ed1fb596275fee9ebca0f3d1093722ca9 (patch) | |
tree | d9fbcc4fbb6c54bae64e5c0160f3a28a2ca0e934 /make/config/clImplCustomCode.java | |
parent | e56a17d6d7780b8597c78ce50808c8da68d094b5 (diff) |
Add explicit version number to original CL impl classes.
This makes all three versions (1.1, 1.2, and 2.0) use the same naming
convention, and sets me up to use the unversioned name to factor out
code common to all three.
Diffstat (limited to 'make/config/clImplCustomCode.java')
-rw-r--r-- | make/config/clImplCustomCode.java | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/make/config/clImplCustomCode.java b/make/config/clImplCustomCode.java deleted file mode 100644 index e4fd2dcf..00000000 --- a/make/config/clImplCustomCode.java +++ /dev/null @@ -1,60 +0,0 @@ - - /** If null, OpenCL is not available on this machine. */ - static final DynamicLibraryBundle dynamicLookupHelper; - protected static final CLProcAddressTable addressTable; - - static { - addressTable = new CLProcAddressTable(); - 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 CLProcAddressTable getCLProcAddressTable() { 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 CLAbstractImpl() { - } - - /** 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); - |