public static Map<String, Method> infoMethods(Class<?> c) { Map<String, Method> mets = new TreeMap<String, Method>(); for (Method met : c.getMethods()) { InfoName name = met.getAnnotation(InfoName.class); if (name == null) { continue; } mets.put(name.value(), met); } return mets; }
@InfoName("cl_nv_device_attribute_query") public boolean isNVDeviceAttributeQuerySupported() { return hasExtension("cl_nv_device_attribute_query"); }
@InfoName("cl_khr_byte_addressable_store") public boolean isByteAddressableStoreSupported() { return hasExtension("cl_khr_byte_addressable_store"); }
public static Map<String, Method> infoMethods(Class<?> c) { Map<String, Method> mets = new TreeMap<String, Method>(); for (Method met : c.getMethods()) { InfoName name = met.getAnnotation(InfoName.class); if (name == null) { continue; } mets.put(name.value(), met); } return mets; }
/** * Returns a list of extension names <br> * Extensions defined here must be supported by all devices associated with this platform. */ @InfoName("CL_PLATFORM_EXTENSIONS") public String[] getExtensions() { if (extensions == null) { extensions = new LinkedHashSet<String>(Arrays.asList(infos.getString(getEntity(), CL_PLATFORM_EXTENSIONS).split("\\s+"))); } return extensions.toArray(new String[extensions.size()]); } private Set<String> extensions;
/** * List of built-in kernels supported by the device. */ @InfoName("CL_DEVICE_BUILT_IN_KERNELS") public String[] getBuiltInKernels() { if (buildInKernels == null) { buildInKernels = new LinkedHashSet<String>(Arrays.asList(infos.getString(getEntity(), CL_DEVICE_BUILT_IN_KERNELS).split(";"))); } return buildInKernels.toArray(new String[buildInKernels.size()]); } private Set<String> buildInKernels;
/** * Returns a list of extension names <br> * Extensions defined here must be supported by all devices associated with this platform. */ @InfoName("CL_PLATFORM_EXTENSIONS") public String[] getExtensions() { if (extensions == null) { extensions = new LinkedHashSet<String>(Arrays.asList(infos.getString(getEntity(), CL_PLATFORM_EXTENSIONS).split("\\s+"))); } return extensions.toArray(new String[extensions.size()]); } private Set<String> extensions;
/** * List of built-in kernels supported by the device. */ @InfoName("CL_DEVICE_BUILT_IN_KERNELS") public String[] getBuiltInKernels() { if (buildInKernels == null) { buildInKernels = new LinkedHashSet<String>(Arrays.asList(infos.getString(getEntity(), CL_DEVICE_BUILT_IN_KERNELS).split(";"))); } return buildInKernels.toArray(new String[buildInKernels.size()]); } private Set<String> buildInKernels;
/** * 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); }
/** * Max depth of 3D image in pixels. <br> * The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. */ @InfoName("CL_DEVICE_IMAGE3D_MAX_DEPTH") public long getImage3DMaxDepth() { return infos.getIntOrLong(getEntity(), CL_DEVICE_IMAGE3D_MAX_DEPTH); }
/** * Maximum number of samplers that can be used in a kernel. <br> * Refer to section 6.11.8 for a detailed description on samplers. <br> * The minimum value is 16 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. */ @InfoName("CL_DEVICE_MAX_SAMPLERS") public int getMaxSamplers() { return infos.getInt(getEntity(), CL_DEVICE_MAX_SAMPLERS); }
/** 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); }
/** * OpenCL profile string. Returns the profile name supported by the implementation. The profile name returned can be one of the following strings: * <ul> * <li>FULL_PROFILE if the implementation supports the OpenCL specification (functionality defined as part of the core specification and does not require any extensions to be supported).</li> * <li>EMBEDDED_PROFILE if the implementation supports the OpenCL embedded profile. The embedded profile is defined to be a subset for each version of OpenCL. The embedded profile for OpenCL 1.0 is described in section 10.</li> * </ul> */ @InfoName("CL_PLATFORM_PROFILE") public String getProfile() { return infos.getString(getEntity(), CL_PLATFORM_PROFILE); }
/** * Return the value specified by normalized_coords argument to CLContext.createSampler. */ @InfoName("CL_SAMPLER_NORMALIZED_COORDS") public boolean getNormalizedCoords() { return infos.getBool(getEntity(), CL_SAMPLER_NORMALIZED_COORDS); }
/** * Return the execution status of the command identified by event. <br> * @throws CLException is the execution status denotes an error */ @InfoName("CL_EVENT_COMMAND_EXECUTION_STATUS") public int getCommandExecutionStatusValue() { return infos.getInt(getEntity(), CL_EVENT_COMMAND_EXECUTION_STATUS); }
/** * A 64-bit value that describes the current device time counter in nanoseconds when the command identified by event starts execution on the device. */ @InfoName("CL_CL_PROFILING_COMMAND_START") public long getProfilingCommandStart() { return profilingInfos.getIntOrLong(getEntity(), CL_PROFILING_COMMAND_START); }
/** * 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); }