private EnumSet<PartitionType> getPartitionTypeInfo(int info) { EnumSet<PartitionType> ret = EnumSet.noneOf(PartitionType.class); Pointer<?> ptr = infos.getMemory(getEntity(), info); if (ptr != null) { Pointer<SizeT> props = ptr.as(SizeT.class); for (long i = 0, n = props.getValidElements(); i < n; i++) { long value = props.getSizeTAtIndex(i); if (value == 0) { break; } ret.add(PartitionType.getEnum(value)); } } return ret; }
/** * Affinity domain specified in {@link #createSubDevicesByAffinity(AffinityDomain)}, or null if the device is not a sub-device or wasn't split by affinity. * This returns part of CL_DEVICE_PARTITION_TYPE. */ public AffinityDomain getPartitionAffinityDomain() { Pointer<?> memory = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_TYPE); long type = memory.getSizeT(); if (type != CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) { return null; } AffinityDomain affinityDomain = AffinityDomain.getEnum(memory.getSizeTAtIndex(1)); return affinityDomain; }
/** * Affinity domain specified in {@link #createSubDevicesByAffinity(AffinityDomain)}, or null if the device is not a sub-device or wasn't split by affinity. * This returns part of CL_DEVICE_PARTITION_TYPE. */ public AffinityDomain getPartitionAffinityDomain() { Pointer<?> memory = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_TYPE); long type = memory == null ? 0 : memory.getSizeT(); if (type != CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) { return null; } AffinityDomain affinityDomain = AffinityDomain.getEnum(memory.getSizeTAtIndex(1)); return affinityDomain; }
/** * Return image format descriptor specified when image is created with CLContext.create{Input|Output|InputOutput}{2D|3D}. */ @InfoName("CL_IMAGE_FORMAT") public CLImageFormat getFormat() { if (format == null) { format = new CLImageFormat(new cl_image_format(infos.getMemory(getEntity(), CL_IMAGE_FORMAT))); } return format; }
/** * Return image format descriptor specified when image is created with CLContext.create{Input|Output|InputOutput}{2D|3D}. */ @InfoName("CL_IMAGE_FORMAT") public CLImageFormat getFormat() { if (format == null) { format = new CLImageFormat(new cl_image_format(infos.getMemory(getEntity(), CL_IMAGE_FORMAT))); } return format; }
/** * Lists the devices of this context * @return array of the devices that form this context */ public synchronized CLDevice[] getDevices() { if (deviceIds == null) { deviceIds = infos.getMemory(getEntity(), CL_CONTEXT_DEVICES).as(SizeT.class); } int n = (int)deviceIds.getValidElements(); CLDevice[] devices = new CLDevice[n]; for (int i = n; i-- != 0;) { devices[i] = new CLDevice(platform, deviceIds.getSizeTAtIndex(i)); } return devices; }
/** * Lists the devices of this context * @return array of the devices that form this context */ public synchronized CLDevice[] getDevices() { if (deviceIds == null) { deviceIds = infos.getMemory(getEntity(), CL_CONTEXT_DEVICES).as(SizeT.class); } int n = (int)deviceIds.getValidElements(); CLDevice[] devices = new CLDevice[n]; for (int i = n; i-- != 0;) { devices[i] = new CLDevice(platform, deviceIds.getSizeTAtIndex(i)); } return devices; }
Pointer<?> s = infos.getMemory(getEntity(), CL_PROGRAM_BINARY_SIZES); int n = (int)s.getValidBytes() / Platform.SIZE_T_SIZE; long[] sizes = s.getSizeTs(n);
Pointer<?> s = infos.getMemory(getEntity(), CL_PROGRAM_BINARY_SIZES); int n = (int)s.getValidBytes() / Platform.SIZE_T_SIZE; long[] sizes = s.getSizeTs(n);