Skip to content

Commit 3cedcfc

Browse files
committed
CL_DEVICE_PARTITION_AFFINITY_DOMAIN is a bit field, not a properties list
1 parent 30ab47f commit 3cedcfc

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -764,19 +764,7 @@ private EnumSet<PartitionType> getPartitionTypeInfo(int info) {
764764
*/
765765
@InfoName("CL_DEVICE_PARTITION_AFFINITY_DOMAIN")
766766
public EnumSet<AffinityDomain> getPartitionAffinityDomains() {
767-
EnumSet<AffinityDomain> ret = EnumSet.noneOf(AffinityDomain.class);
768-
Pointer<?> ptr = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN);
769-
if (ptr != null) {
770-
Pointer<SizeT> props = ptr.as(SizeT.class);
771-
for (long i = 0, n = props.getValidElements(); i < n; i++) {
772-
long value = props.getSizeTAtIndex(i);
773-
if (value == 0) {
774-
break;
775-
}
776-
ret.add(AffinityDomain.getEnum(value));
777-
}
778-
}
779-
return ret;
767+
return AffinityDomain.getEnumSet(infos.getIntOrLong(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN));
780768
}
781769
782770
@InfoName("CL_DEVICE_PARTITION_MAX_SUB_DEVICES")
@@ -1169,6 +1157,9 @@ public enum AffinityDomain implements com.nativelibs4java.util.ValuedEnum {
11691157
public static AffinityDomain getEnum(long v) {
11701158
return EnumValues.getEnum(v, AffinityDomain.class);
11711159
}
1160+
public static EnumSet<AffinityDomain> getEnumSet(long v) {
1161+
return EnumValues.getEnumSet(v, AffinityDomain.class);
1162+
}
11721163
}
11731164

11741165
/**

0 commit comments

Comments
 (0)