public void process() { try { generateCLCapabilitiesSource(); generateCLPDCapabilitiesSource(CLPlatformExtension.class, PLATFORM_CAPS_CLASS_NAME, CLPlatform.class, "platform"); generateCLPDCapabilitiesSource(CLDeviceExtension.class, DEVICE_CAPS_CLASS_NAME, CLDevice.class, "device"); } catch (IOException e) { throw new RuntimeException(e); } }
private static void initCLIfNecessary() throws Exception { if(clPlatform == null) { clPlatform = CLPlatform.getPlatforms().get(0); clDevices = clPlatform.getDevices(CL10.CL_DEVICE_TYPE_GPU); clContext = CLContext.create(clPlatform, clDevices, null); // TODO: // replace // null clQueue = CL10.clCreateCommandQueue(clContext, clDevices.get(0), CL10.CL_QUEUE_PROFILING_ENABLE, null); // TODO: // replace // null } }