}
HashMap<String, CLKernel> newKernels = new HashMap<String, CLKernel>();
IntBuffer numKernels = newDirectByteBuffer(4).asIntBuffer();
CLKernelBinding kernelBinding = getKernelBinding();
int ret = kernelBinding.clCreateKernelsInProgram(ID, 0, null, numKernels);
if(ret != CL_SUCCESS) {
throw newException(ret, "can not create kernels for "+this);
}
if(numKernels.get(0) > 0) {
NativeSizeBuffer kernelIDs = NativeSizeBuffer.allocateDirect(numKernels.get(0));
ret = kernelBinding.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null);
if(ret != CL_SUCCESS) {
throw newException(ret, "can not create "+kernelIDs.capacity()+" kernels for "+this);
}
for (int i = 0; i < kernelIDs.capacity(); i++) {