/** * 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; }
/** * Max size of memory object allocation in bytes. The minimum value is max (1/4th of CL_DEVICE_GLOBAL_MEM_SIZE , 128*1024*1024) */ @InfoName("CL_DEVICE_MAX_MEM_ALLOC_SIZE") public long getMaxMemAllocSize() { return infos.getIntOrLong(getEntity(), CL_DEVICE_MAX_MEM_ALLOC_SIZE); }
/** * Max number of simultaneous image objects that can be read by a kernel. <br> * The minimum value is 128 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE (@see hasImageSupport()). */ @InfoName("CL_DEVICE_MAX_READ_IMAGE_ARGS") public int getMaxReadImageArgs() { return infos.getInt(getEntity(), CL_DEVICE_MAX_READ_IMAGE_ARGS); }
/** * Size of global memory cache line in bytes. */ @InfoName("CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE") public int getGlobalMemCachelineSize() { return infos.getInt(getEntity(), CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE); }
/** * Size of global memory cache in bytes. */ @InfoName("CL_DEVICE_GLOBAL_MEM_CACHE_SIZE") public long getGlobalMemCacheSize() { return infos.getIntOrLong(getEntity(), CL_DEVICE_GLOBAL_MEM_CACHE_SIZE); }
/** * Is CL_TRUE if the device is available and CL_FALSE if the device is not available. */ @InfoName("CL_DEVICE_AVAILABLE") public boolean isAvailable() { return infos.getBool(getEntity(), CL_DEVICE_AVAILABLE); }
/** Device name string. */ @InfoName("CL_DEVICE_NAME") public String getName() { return infos.getString(getEntity(), CL_DEVICE_NAME); }
/** OpenCL software driver version string in the form major_number.minor_number. */ @InfoName("CL_DRIVER_VERSION") public String getDriverVersion() { return infos.getString(getEntity(), CL_DRIVER_VERSION); }
/** TODO */ @InfoName("CL_DEVICE_REFERENCE_COUNT") public long getReferenceCount() { return infos.getIntOrLong(getEntity(), CL_DEVICE_REFERENCE_COUNT); }
/** * Preferred native vector width size for built-in scalar types that can be put into vectors. <br> * The vector width is defined as the number of scalar elements that can be stored in the vector. <br> * If the cl_khr_fp64 extension is not supported, CL_DEVICE_PREFERRED_VECTOR_WID TH_DOUBLE must return 0. */ @InfoName("CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG") public int getPreferredVectorWidthLong() { return infos.getInt(getEntity(), CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG); }
@Override protected void clear() { if (needsRelease) error(CL.clReleaseDevice(getEntity())); }
/** * Max number of simultaneous image objects that can be written to by a kernel. <br> * The minimum value is 8 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE (@see hasImageSupport()). */ @InfoName("CL_DEVICE_MAX_WRITE_IMAGE_ARGS") public int getMaxWriteImageArgs() { return infos.getInt(getEntity(), CL_DEVICE_MAX_WRITE_IMAGE_ARGS); }
/** * Max height of 3D image in pixels. <br> * The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. */ @InfoName("CL_DEVICE_IMAGE3D_MAX_HEIGHT") public long getImage3DMaxHeight() { return infos.getIntOrLong(getEntity(), CL_DEVICE_IMAGE3D_MAX_HEIGHT); }
/** TODO */ @InfoName("CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF") public long getNativeVectorWidthHalf() { return infos.getIntOrLong(getEntity(), CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF); }
/** * Returns the native ISA vector width. <br> * The vector width is defined as the number of scalar elements that can be stored in the vector. <br> * If the cl_khr_fp64 extension is not supported, CL_DEVICE_NATIVE_VECTOR_WID TH_DOUBLE must return 0. */ @InfoName("CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR") public int getNativeVectorWidthChar() { return infos.getOptionalFeatureInt(getEntity(), CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR); }
/** * Describes the execution capabilities of the device.<br> * The mandated minimum capability is: Kernel. */ @InfoName("CL_DEVICE_EXECUTION_CAPABILITIES") public EnumSet<ExecutionCapability> getExecutionCapabilities() { return ExecutionCapability.getEnumSet(infos.getIntOrLong(getEntity(), CL_DEVICE_EXECUTION_CAPABILITIES)); }
/** TODO */ @InfoName("CL_DEVICE_DOUBLE_FP_CONFIG") public EnumSet<FpConfig> getDoubleFpConfig() { return isDoubleSupported() ? FpConfig.getEnumSet(infos.getIntOrLong(getEntity(), CL_DEVICE_DOUBLE_FP_CONFIG)) : EnumSet.noneOf(FpConfig.class); }
/** * Whether the device and the host have a unified memory subsystem. * @since OpenCL 1.1 */ @InfoName("CL_DEVICE_HOST_UNIFIED_MEMORY") public boolean isHostUnifiedMemory() { platform.requireMinVersionValue("CL_DEVICE_HOST_UNIFIED_MEMORY", 1.1); return infos.getBool(getEntity(), CL_DEVICE_HOST_UNIFIED_MEMORY); }
/** * Type of local memory supported. <br> */ @InfoName("CL_DEVICE_LOCAL_MEM_TYPE") public LocalMemType getLocalMemType() { return LocalMemType.getEnum(infos.getInt(getEntity(), CL_DEVICE_LOCAL_MEM_TYPE)); }
/** * Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateCommandQueue.html">clCreateCommandQueue</a>.<br> */ @Deprecated public CLQueue createQueue(EnumSet<QueueProperties> queueProperties, CLContext context) { ReusablePointers ptrs = ReusablePointers.get(); Pointer<Integer> pErr = ptrs.pErr; long queue = CL.clCreateCommandQueue(context.getEntity(), getEntity(), QueueProperties.getValue(queueProperties), getPeer(pErr)); error(pErr.getInt()); return new CLQueue(context, queue, this); }