Skip to content

Commit c56499c

Browse files
authored
[SYCL][HIP] Check total local size before kernel launch (#4929)
This is the exact same check as in the CUDA plugin however it was missing from the HIP plugin apparently. This fixes the llvm-test-suite test `DeprecatedFeatures/parallel_for_range.cpp` with HIP.
1 parent 3ac6f90 commit c56499c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sycl/plugins/hip/pi_hip.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,6 +2536,11 @@ pi_result hip_piEnqueueKernelLaunch(
25362536
}
25372537
}
25382538

2539+
if (maxWorkGroupSize <
2540+
size_t(threadsPerBlock[0] * threadsPerBlock[1] * threadsPerBlock[2])) {
2541+
return PI_INVALID_WORK_GROUP_SIZE;
2542+
}
2543+
25392544
int blocksPerGrid[3] = {1, 1, 1};
25402545

25412546
for (size_t i = 0; i < work_dim; i++) {

0 commit comments

Comments
 (0)