Skip to content

Commit 7e6f724

Browse files
[SYCL][Reduction] Check aspect::usm_device_allocations before using it (#6869)
Follow-up for #6858 based on post-commit review.
1 parent e1794b6 commit 7e6f724

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sycl/include/sycl/reduction.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,11 @@ bool reduCGFuncForRangeFastReduce(handler &CGH, KernelType KernelFunc,
988988
});
989989
};
990990

991-
// Integrated/discrete GPUs have different faster path.
992-
if (getDeviceFromHandler(CGH).get_info<info::device::host_unified_memory>())
991+
auto device = getDeviceFromHandler(CGH);
992+
// Integrated/discrete GPUs have different faster path. For discrete GPUs fast
993+
// path requires USM device allocations though, so check for that as well.
994+
if (device.get_info<info::device::host_unified_memory>() ||
995+
!device.has(aspect::usm_device_allocations))
993996
Rest(Redu.getReadWriteAccessorToInitializedGroupsCounter(CGH));
994997
else
995998
Rest(Redu.getGroupsCounterAccDiscrete(CGH));

0 commit comments

Comments
 (0)