/** * This provides a mechanism for the application to query the maximum work-group size that can be used to execute a kernel on a specific device given by device. <br> * The OpenCL implementation uses the resource requirements of the kernel (register usage etc.) to determine what this work- group size should be.<br> * See <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetKernelWorkGroupInfo.html">CL_KERNEL_WORK_GROUP_SIZE</a> */ public Map<CLDevice, Long> getWorkGroupSize() { CLDevice[] devices = program.getDevices(); Map<CLDevice, Long> ret = new HashMap<CLDevice, Long>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getIntOrLong(device.getEntity(), CL_KERNEL_WORK_GROUP_SIZE)); return ret; }
/** * This provides a mechanism for the application to query the maximum work-group size that can be used to execute a kernel on a specific device given by device. <br> * The OpenCL implementation uses the resource requirements of the kernel (register usage etc.) to determine what this work- group size should be.<br> * See <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetKernelWorkGroupInfo.html">CL_KERNEL_WORK_GROUP_SIZE</a> */ public Map<CLDevice, Long> getWorkGroupSize() { CLDevice[] devices = program.getDevices(); Map<CLDevice, Long> ret = new HashMap<CLDevice, Long>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getIntOrLong(device.getEntity(), CL_KERNEL_WORK_GROUP_SIZE)); return ret; }
/** * Returns the work-group size specified by the __attribute__((reqd_work_gr oup_size(X, Y, Z))) qualifier.<br> * Refer to section 6.7.2.<br> * If the work-group size is not specified using the above attribute qualifier (0, 0, 0) is returned.<br> * See <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetKernelWorkGroupInfo.html">CL_KERNEL_COMPILE_WORK_GROUP_SIZE</a> * @return for each CLDevice, array of 3 longs */ public Map<CLDevice, long[]> getCompileWorkGroupSize() { CLDevice[] devices = program.getDevices(); Map<CLDevice, long[]> ret = new HashMap<CLDevice, long[]>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getNativeSizes(device.getEntity(), CL_KERNEL_COMPILE_WORK_GROUP_SIZE, 3)); return ret; }
/** * Returns the work-group size specified by the __attribute__((reqd_work_gr oup_size(X, Y, Z))) qualifier.<br> * Refer to section 6.7.2.<br> * If the work-group size is not specified using the above attribute qualifier (0, 0, 0) is returned.<br> * See <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetKernelWorkGroupInfo.html">CL_KERNEL_COMPILE_WORK_GROUP_SIZE</a> * @return for each CLDevice, array of 3 longs */ public Map<CLDevice, long[]> getCompileWorkGroupSize() { CLDevice[] devices = program.getDevices(); Map<CLDevice, long[]> ret = new HashMap<CLDevice, long[]>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getNativeSizes(device.getEntity(), CL_KERNEL_COMPILE_WORK_GROUP_SIZE, 3)); return ret; }
/** * Returns the amount of local memory in bytes being used by a kernel. <br> * This includes local memory that may be needed by an implementation to execute the kernel, variables declared inside the kernel with the __local address qualifier and local memory to be allocated for arguments to the kernel declared as pointers with the __local address qualifier and whose size is specified with clSetKernelArg.<br> * If the local memory size, for any pointer argument to the kernel declared with the __local address qualifier, is not specified, its size is assumed to be 0.<br> * See <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetKernelWorkGroupInfo.html">CL_KERNEL_LOCAL_MEM_SIZE</a> */ public Map<CLDevice, Long> getLocalMemSize() { CLDevice[] devices = program.getDevices(); Map<CLDevice, Long> ret = new HashMap<CLDevice, Long>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getIntOrLong(device.getEntity(), CL_KERNEL_LOCAL_MEM_SIZE)); return ret; }
/** * Returns the amount of local memory in bytes being used by a kernel. <br> * This includes local memory that may be needed by an implementation to execute the kernel, variables declared inside the kernel with the __local address qualifier and local memory to be allocated for arguments to the kernel declared as pointers with the __local address qualifier and whose size is specified with clSetKernelArg.<br> * If the local memory size, for any pointer argument to the kernel declared with the __local address qualifier, is not specified, its size is assumed to be 0.<br> * See <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetKernelWorkGroupInfo.html">CL_KERNEL_LOCAL_MEM_SIZE</a> */ public Map<CLDevice, Long> getLocalMemSize() { CLDevice[] devices = program.getDevices(); Map<CLDevice, Long> ret = new HashMap<CLDevice, Long>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getIntOrLong(device.getEntity(), CL_KERNEL_LOCAL_MEM_SIZE)); return ret; }
/** * Returns the preferred multiple of work- group size for launch. <br> * This is a performance hint. <br> * Specifying a work- group size that is not a multiple of the value returned by this query as the value of the local work size argument to clEnqueueNDRangeKernel will not fail to enqueue the kernel for execution unless the work-group size specified is larger than the device maximum. * @since OpenCL 1.1 */ public Map<CLDevice, Long> getPreferredWorkGroupSizeMultiple() { program.getContext().getPlatform().requireMinVersionValue("CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE", 1.1); CLDevice[] devices = program.getDevices(); Map<CLDevice, Long> ret = new HashMap<CLDevice, Long>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getIntOrLong(device.getEntity(), CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE)); return ret; }
/** * Returns the preferred multiple of work- group size for launch. <br> * This is a performance hint. <br> * Specifying a work- group size that is not a multiple of the value returned by this query as the value of the local work size argument to clEnqueueNDRangeKernel will not fail to enqueue the kernel for execution unless the work-group size specified is larger than the device maximum. * @since OpenCL 1.1 */ public Map<CLDevice, Long> getPreferredWorkGroupSizeMultiple() { program.getContext().getPlatform().requireMinVersionValue("CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE", 1.1); CLDevice[] devices = program.getDevices(); Map<CLDevice, Long> ret = new HashMap<CLDevice, Long>(devices.length); for (CLDevice device : devices) ret.put(device, getKernelInfos().getIntOrLong(device.getEntity(), CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE)); return ret; }