Skip to content

Commit 17fdcc7

Browse files
committed
Replace urEnqueueKernelLaunch() property list with pNext chain property structs
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 446a453 commit 17fdcc7

File tree

57 files changed

+824
-768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+824
-768
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,39 +2513,42 @@ static ur_result_t SetKernelParamsAndLaunch(
25132513
NDRDesc.GlobalOffset[1] != 0 ||
25142514
NDRDesc.GlobalOffset[2] != 0;
25152515

2516-
std::vector<ur_kernel_launch_property_t> property_list;
2516+
ur_kernel_launch_ext_properties_t property_list = {
2517+
UR_STRUCTURE_TYPE_KERNEL_LAUNCH_EXT_PROPERTIES, nullptr, 0};
2518+
void **last_pNext = &property_list.pNext;
25172519

25182520
if (KernelUsesClusterLaunch) {
2519-
ur_kernel_launch_property_value_t launch_property_value_cluster_range;
2520-
launch_property_value_cluster_range.clusterDim[0] =
2521-
NDRDesc.ClusterDimensions[0];
2522-
launch_property_value_cluster_range.clusterDim[1] =
2523-
NDRDesc.ClusterDimensions[1];
2524-
launch_property_value_cluster_range.clusterDim[2] =
2525-
NDRDesc.ClusterDimensions[2];
2526-
2527-
property_list.push_back({UR_KERNEL_LAUNCH_PROPERTY_ID_CLUSTER_DIMENSION,
2528-
launch_property_value_cluster_range});
2521+
ur_kernel_launch_cluster_property_t launch_property_cluster_range;
2522+
launch_property_cluster_range.stype =
2523+
UR_STRUCTURE_TYPE_KERNEL_LAUNCH_CLUSTER_PROPERTY;
2524+
launch_property_cluster_range.pNext = nullptr;
2525+
launch_property_cluster_range.clusterDim[0] = NDRDesc.ClusterDimensions[0];
2526+
launch_property_cluster_range.clusterDim[1] = NDRDesc.ClusterDimensions[1];
2527+
launch_property_cluster_range.clusterDim[2] = NDRDesc.ClusterDimensions[2];
2528+
*last_pNext = &launch_property_cluster_range;
2529+
last_pNext = &launch_property_cluster_range.pNext;
25292530
}
25302531
if (IsCooperative) {
2531-
ur_kernel_launch_property_value_t launch_property_value_cooperative;
2532-
launch_property_value_cooperative.cooperative = 1;
2533-
property_list.push_back({UR_KERNEL_LAUNCH_PROPERTY_ID_COOPERATIVE,
2534-
launch_property_value_cooperative});
2532+
property_list.flags |= UR_KERNEL_LAUNCH_FLAG_COOPERATIVE;
25352533
}
25362534
// If there is no implicit arg, let the driver handle it via a property
25372535
if (WorkGroupMemorySize && !ImplicitLocalArg.has_value()) {
2538-
property_list.push_back({UR_KERNEL_LAUNCH_PROPERTY_ID_WORK_GROUP_MEMORY,
2539-
{{WorkGroupMemorySize}}});
2536+
ur_kernel_launch_workgroup_property_t workgroup_property;
2537+
workgroup_property.stype =
2538+
UR_STRUCTURE_TYPE_KERNEL_LAUNCH_WORKGROUP_PROPERTY;
2539+
workgroup_property.pNext = nullptr;
2540+
workgroup_property.workgroup_mem_size = WorkGroupMemorySize;
2541+
*last_pNext = &workgroup_property;
2542+
last_pNext = &workgroup_property.pNext;
25402543
}
25412544
ur_event_handle_t UREvent = nullptr;
25422545
ur_result_t Error =
25432546
Adapter.call_nocheck<UrApiKind::urEnqueueKernelLaunchWithArgsExp>(
25442547
Queue.getHandleRef(), Kernel, NDRDesc.Dims,
25452548
HasOffset ? &NDRDesc.GlobalOffset[0] : nullptr,
25462549
&NDRDesc.GlobalSize[0], LocalSize, UrArgs.size(), UrArgs.data(),
2547-
property_list.size(),
2548-
property_list.empty() ? nullptr : property_list.data(),
2550+
(property_list.flags || property_list.pNext) ? &property_list
2551+
: nullptr,
25492552
RawEvents.size(), RawEvents.empty() ? nullptr : &RawEvents[0],
25502553
OutEventImpl ? &UREvent : nullptr);
25512554
if (Error == UR_RESULT_SUCCESS && OutEventImpl) {

unified-runtime/examples/codegen/codegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int main() {
150150
const size_t lWorkSize[] = {1, 1, 1};
151151
ur_event_handle_t event;
152152
ur_check(urEnqueueKernelLaunch(queue, hKernel, 3, gWorkOffset, gWorkSize,
153-
lWorkSize, 0, nullptr, &event));
153+
lWorkSize, nullptr, &event));
154154

155155
ur_check(urEnqueueMemBufferRead(queue, dB, true, 0, a_size * sizeof(int),
156156
b.data, 1, &event, nullptr));

unified-runtime/include/ur_api.h

Lines changed: 69 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/include/ur_ddi.h

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/include/ur_print.h

Lines changed: 26 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)