Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions sycl/source/detail/scheduler/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2514,39 +2514,42 @@ static ur_result_t SetKernelParamsAndLaunch(
NDRDesc.GlobalOffset[1] != 0 ||
NDRDesc.GlobalOffset[2] != 0;

std::vector<ur_kernel_launch_property_t> property_list;
ur_kernel_launch_ext_properties_t property_list = {
UR_STRUCTURE_TYPE_KERNEL_LAUNCH_EXT_PROPERTIES, nullptr, 0};
void **last_pNext = &property_list.pNext;

if (KernelUsesClusterLaunch) {
ur_kernel_launch_property_value_t launch_property_value_cluster_range;
launch_property_value_cluster_range.clusterDim[0] =
NDRDesc.ClusterDimensions[0];
launch_property_value_cluster_range.clusterDim[1] =
NDRDesc.ClusterDimensions[1];
launch_property_value_cluster_range.clusterDim[2] =
NDRDesc.ClusterDimensions[2];

property_list.push_back({UR_KERNEL_LAUNCH_PROPERTY_ID_CLUSTER_DIMENSION,
launch_property_value_cluster_range});
ur_kernel_launch_cluster_property_t launch_property_cluster_range;
launch_property_cluster_range.stype =
UR_STRUCTURE_TYPE_KERNEL_LAUNCH_CLUSTER_PROPERTY;
launch_property_cluster_range.pNext = nullptr;
launch_property_cluster_range.clusterDim[0] = NDRDesc.ClusterDimensions[0];
launch_property_cluster_range.clusterDim[1] = NDRDesc.ClusterDimensions[1];
launch_property_cluster_range.clusterDim[2] = NDRDesc.ClusterDimensions[2];
*last_pNext = &launch_property_cluster_range;
last_pNext = &launch_property_cluster_range.pNext;
}
if (IsCooperative) {
ur_kernel_launch_property_value_t launch_property_value_cooperative;
launch_property_value_cooperative.cooperative = 1;
property_list.push_back({UR_KERNEL_LAUNCH_PROPERTY_ID_COOPERATIVE,
launch_property_value_cooperative});
property_list.flags |= UR_KERNEL_LAUNCH_FLAG_COOPERATIVE;
}
// If there is no implicit arg, let the driver handle it via a property
if (WorkGroupMemorySize && !ImplicitLocalArg.has_value()) {
property_list.push_back({UR_KERNEL_LAUNCH_PROPERTY_ID_WORK_GROUP_MEMORY,
{{WorkGroupMemorySize}}});
ur_kernel_launch_workgroup_property_t workgroup_property;
workgroup_property.stype =
UR_STRUCTURE_TYPE_KERNEL_LAUNCH_WORKGROUP_PROPERTY;
workgroup_property.pNext = nullptr;
workgroup_property.workgroup_mem_size = WorkGroupMemorySize;
*last_pNext = &workgroup_property;
last_pNext = &workgroup_property.pNext;
}
ur_event_handle_t UREvent = nullptr;
ur_result_t Error =
Adapter.call_nocheck<UrApiKind::urEnqueueKernelLaunchWithArgsExp>(
Queue.getHandleRef(), Kernel, NDRDesc.Dims,
HasOffset ? &NDRDesc.GlobalOffset[0] : nullptr,
&NDRDesc.GlobalSize[0], LocalSize, UrArgs.size(), UrArgs.data(),
property_list.size(),
property_list.empty() ? nullptr : property_list.data(),
(property_list.flags || property_list.pNext) ? &property_list
: nullptr,
RawEvents.size(), RawEvents.empty() ? nullptr : &RawEvents[0],
OutEventImpl ? &UREvent : nullptr);
if (Error == UR_RESULT_SUCCESS && OutEventImpl) {
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/examples/codegen/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main() {
const size_t lWorkSize[] = {1, 1, 1};
ur_event_handle_t event;
ur_check(urEnqueueKernelLaunch(queue, hKernel, 3, gWorkOffset, gWorkSize,
lWorkSize, 0, nullptr, &event));
lWorkSize, nullptr, &event));

ur_check(urEnqueueMemBufferRead(queue, dB, true, 0, a_size * sizeof(int),
b.data, 1, &event, nullptr));
Expand Down
126 changes: 71 additions & 55 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions unified-runtime/include/ur_ddi.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 26 additions & 6 deletions unified-runtime/include/ur_print.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading