Skip to content

Commit bdabf8c

Browse files
authored
[UR][Offload] Bump kernel launching after launchargs change (#18957)
Update UR adapter due to changes in llvm/llvm-project#143901
1 parent 18cf869 commit bdabf8c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

unified-runtime/source/adapters/offload/enqueue.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,24 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
4747
}
4848

4949
if (GroupSize[0] > GlobalSize[0] || GroupSize[1] > GlobalSize[1] ||
50-
GroupSize[2] > GlobalSize[2]) {
50+
GroupSize[2] > GlobalSize[2] ||
51+
GroupSize[0] > std::numeric_limits<uint32_t>::max() ||
52+
GroupSize[1] > std::numeric_limits<uint32_t>::max() ||
53+
GroupSize[2] > std::numeric_limits<uint32_t>::max() ||
54+
GlobalSize[0] / GroupSize[0] > std::numeric_limits<uint32_t>::max() ||
55+
GlobalSize[1] / GroupSize[1] > std::numeric_limits<uint32_t>::max() ||
56+
GlobalSize[2] / GroupSize[2] > std::numeric_limits<uint32_t>::max()) {
5157
return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE;
5258
}
5359

5460
ol_kernel_launch_size_args_t LaunchArgs;
5561
LaunchArgs.Dimensions = workDim;
56-
LaunchArgs.NumGroupsX = GlobalSize[0] / GroupSize[0];
57-
LaunchArgs.NumGroupsY = GlobalSize[1] / GroupSize[1];
58-
LaunchArgs.NumGroupsZ = GlobalSize[2] / GroupSize[2];
59-
LaunchArgs.GroupSizeX = GroupSize[0];
60-
LaunchArgs.GroupSizeY = GroupSize[1];
61-
LaunchArgs.GroupSizeZ = GroupSize[2];
62+
LaunchArgs.NumGroups.x = GlobalSize[0] / GroupSize[0];
63+
LaunchArgs.NumGroups.y = GlobalSize[1] / GroupSize[1];
64+
LaunchArgs.NumGroups.z = GlobalSize[2] / GroupSize[2];
65+
LaunchArgs.GroupSize.x = GroupSize[0];
66+
LaunchArgs.GroupSize.y = GroupSize[1];
67+
LaunchArgs.GroupSize.z = GroupSize[2];
6268
LaunchArgs.DynSharedMemory = 0;
6369

6470
ol_event_handle_t EventOut;

0 commit comments

Comments
 (0)