Skip to content

Commit 2ac19e5

Browse files
authored
Revert "[UR][L0 Adapter] Fix an OOB access (#18373)"
This reverts commit 65cf13e.
1 parent cda5a47 commit 2ac19e5

File tree

1 file changed

+9
-5
lines changed
  • unified-runtime/source/adapters/level_zero

1 file changed

+9
-5
lines changed

unified-runtime/source/adapters/level_zero/kernel.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,15 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp(
279279

280280
if (LocalWorkSize) {
281281
// L0
282-
for (int I = 0; I < WorkDim; I++) {
283-
UR_ASSERT(LocalWorkSize[I] < (std::numeric_limits<uint32_t>::max)(),
284-
UR_RESULT_ERROR_INVALID_VALUE);
285-
WG[I] = static_cast<uint32_t>(LocalWorkSize[I]);
286-
}
282+
UR_ASSERT(LocalWorkSize[0] < (std::numeric_limits<uint32_t>::max)(),
283+
UR_RESULT_ERROR_INVALID_VALUE);
284+
UR_ASSERT(LocalWorkSize[1] < (std::numeric_limits<uint32_t>::max)(),
285+
UR_RESULT_ERROR_INVALID_VALUE);
286+
UR_ASSERT(LocalWorkSize[2] < (std::numeric_limits<uint32_t>::max)(),
287+
UR_RESULT_ERROR_INVALID_VALUE);
288+
WG[0] = static_cast<uint32_t>(LocalWorkSize[0]);
289+
WG[1] = static_cast<uint32_t>(LocalWorkSize[1]);
290+
WG[2] = static_cast<uint32_t>(LocalWorkSize[2]);
287291
} else {
288292
// We can't call to zeKernelSuggestGroupSize if 64-bit GlobalWorkSize
289293
// values do not fit to 32-bit that the API only supports currently.

0 commit comments

Comments
 (0)