}
}
try {
final CLProcAddressTable table = new CLProcAddressTable(new FunctionAddressResolver() {
@Override
public long resolve(String name, DynamicLookupHelper lookup) {
if(name.endsWith("KHR") || name.endsWith("EXT")) {
long address = ((CLImpl) cl).clGetExtensionFunctionAddress(name);
if(address != 0) {
return address;
}
}
return lookup.dynamicLookupFunction(name);
}
});
cl = new CLImpl(table);
//load JOCL and init table
doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
NativeLibrary libOpenCL = JOCLJNILibLoader.loadOpenCL();
if(libOpenCL == null) {
throw new JogampRuntimeException("OpenCL library not found.");
}
//eagerly init function to query extension addresses (used in reset())
table.initEntry("clGetExtensionFunctionAddress", libOpenCL);
table.reset(libOpenCL);
return null;
}
});
// System.out.println("\n"+table);