View Javadoc
1   package net.bmahe.genetics4j.gpu.opencl;
2   
3   import org.apache.commons.lang3.Validate;
4   import org.jocl.CL;
5   import org.jocl.Pointer;
6   import org.jocl.Sizeof;
7   import org.jocl.cl_device_id;
8   import org.jocl.cl_kernel;
9   
10  public class KernelInfoUtils {
11  
12  	private KernelInfoUtils() {
13  
14  	}
15  
16  	public static long getKernelWorkGroupInfoLong(final cl_device_id deviceId, final cl_kernel kernel,
17  			final int parameter) {
18  		Validate.notNull(deviceId);
19  		Validate.notNull(kernel);
20  
21  		final long[] values = new long[1];
22  		CL.clGetKernelWorkGroupInfo(kernel, deviceId, parameter, Sizeof.cl_long, Pointer.to(values), null);
23  
24  		return values[0];
25  	}
26  }