File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
main/velocity/com/nativelibs4java/opencl
test/java/com/nativelibs4java/opencl Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ public long getReferenceCount() {
790790 */
791791 public AffinityDomain getPartitionAffinityDomain() {
792792 Pointer<?> memory = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_TYPE);
793- long type = memory.getSizeT();
793+ long type = memory == null ? 0 : memory .getSizeT();
794794 if (type != CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) {
795795 return null;
796796 }
Original file line number Diff line number Diff line change @@ -88,10 +88,13 @@ public void testSplitByCounts() {
8888 public void testSplitByAffinity () {
8989 if (!device .getPartitionProperties ().contains (CLDevice .PartitionType .ByAffinityDomain )) return ;
9090
91- CLDevice [] subDevices = device .createSubDevicesByAffinity (CLDevice .AffinityDomain .NextPartitionable );
92- assertTrue (subDevices .length > 1 );
93- for (CLDevice subDevice : subDevices ) {
94- checkParent (device , subDevice );
91+ for (CLDevice .AffinityDomain domain : device .getPartitionAffinityDomains ()) {
92+ CLDevice [] subDevices = device .createSubDevicesByAffinity (domain );
93+ assertTrue (subDevices .length > 1 );
94+ for (CLDevice subDevice : subDevices ) {
95+ checkParent (device , subDevice );
96+ assertEquals (domain , subDevice .getPartitionAffinityDomain ());
97+ }
9598 }
9699 }
97100
You can’t perform that action at this time.
0 commit comments