-
Notifications
You must be signed in to change notification settings - Fork 788
[UR][SYCL] Introduce UR api to set kernel args + launch in one call. #18764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp
Outdated
Show resolved
Hide resolved
@@ -1036,6 +1037,77 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueCommandBufferExp( | |||
return UR_RESULT_SUCCESS; | |||
} | |||
|
|||
ur_result_t ur_queue_immediate_in_order_t::enqueueKernelLaunchWithArgsExp( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to move most of the implementation to command_manager.cpp. If we do that, we can:
- avoid taking kernel->mutex twice (commandListLocked->appendKernelLaunch does that internally)
- avoid creating pending_allocations vector - this was only needed for urKernelSetArgMemObj where we need to delay calling zeKernelSetArgumentValue until actual kernel submission. Now, we can just call it directly.
I'm okay doing this myself, though, after this PR is merged. Just wanted to note it somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I ended up doing this as part of a conflict resolution recently
b91b20e
to
76612c5
Compare
@@ -2405,22 +2496,34 @@ static ur_result_t SetKernelParamsAndLaunch( | |||
: Empty); | |||
} | |||
|
|||
std::vector<ur_exp_kernel_arg_properties_t> UrArgs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to keep this vector inside of the queue object so that we don't allocate it (potentially multiple times if there's a lot of arguments) for every kernel launch?
We have a similar mechanism in L0v2 adapter here:
https://github.com/oneapi-src/unified-runtime/blob/main/source/adapters/level_zero/v2/command_list_manager.hpp#L177
76612c5
to
1554457
Compare
7a2f91c
to
6123fa6
Compare
6123fa6
to
cebad02
Compare
No description provided.