Skip to content

Conversation

againull
Copy link
Contributor

No description provided.

Comment on lines 429 to 434
// In multi-device context store the raw pointer value and defer setting the
// argument until we know the device where kernel is being submitted.
if (hKernel->getContext()->getDevices().size() > 1) {
hKernel->addPendingPointerArgument(argIndex, pArgValue);
return UR_RESULT_SUCCESS;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I'd rather we have the same path for both scenarios. But this is going to be rewritten/removed with the transition to enqueue kernel with args, so up to you if you want to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX;
}

pending_pointer_args.push_back({argIndex, pArgValue});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a potential allocation in the hot path. Might be worth testing performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, here is the successful perf testing for this PR: https://github.com/intel/llvm/actions/runs/18106004233

againull added a commit that referenced this pull request Sep 26, 2025
…ice (#20177)

In multi-device context, ensure that pointer kernel arguments are set
only for the device associated with the queue being used for kernel
launch. Previously, arguments were set for all devices in the kernel's
device map, which was unnecessary and potentially incorrect when
launching on a specific device.

Same will be done for v2 adapter here:
#20179
github-actions bot pushed a commit to oneapi-src/unified-runtime that referenced this pull request Sep 27, 2025
In multi-device context, ensure that pointer kernel arguments are set
only for the device associated with the queue being used for kernel
launch. Previously, arguments were set for all devices in the kernel's
device map, which was unnecessary and potentially incorrect when
launching on a specific device.

Same will be done for v2 adapter here:
intel/llvm#20179
uint32_t groupSizeY, uint32_t groupSizeZ,
ze_command_list_handle_t commandList, wait_list_view &waitListView) {
auto hZeKernel = getZeHandle(hDevice);
auto &deviceKernelOpt = deviceKernels[deviceIndex(hDevice)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm wondering whether getZeHandle should also perform this .has_value() check.

@againull againull merged commit 86451eb into intel:sycl Sep 30, 2025
71 of 73 checks passed
@againull againull deleted the set_arg_pending_args_v2 branch September 30, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants