-
Notifications
You must be signed in to change notification settings - Fork 120
Clarification on command buffer specification #1309
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
Comments
1The intention of the wording of 1) is that if an OpenCL implementation is built ontop of a driver API, then it could cache the user passed update configuration, and only propagate it to the driver API on enqueue. Equally the implementation could eagerly go straight to the driver API to propagate the update. Similarly for doing any recompilation eagerly or lazily, which is the motivation listed in the spec. Both eager and lazy ways of propagating the update should be valid implementations of the spec. The API is synchronous, in that when it returns the only 2 mechanisms for the user to view the changes should reflect it A) Not sure if 2I think it should be thread-safe. I can't recall the exact details of why 3The |
|
We in Mobileye implement clUpdateMutableCommandsKHR as thread-safe, but since we don't support simultaneous executions, we don't synchronize the implementation of clEnqueueCommandBufferKHR to keep it lockless and optimized. So, we assume the users will take care of synchronizing updating the commands and enqueuing the command buffer. |
Address point 1) of KhronosGroup#1309 by clarifying when an implementation may defer propogating the changes from `clUpdateMutableCommandsKHR`. I belive the only semantic implication of this is the removing the restriction > This is only possible with a command-buffer created with the CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR flag, as without this the enqueued command-buffer must complete before any modification occurs. So that implementations without simultaneous use support can still defer.
Address point 1) of KhronosGroup#1309 by clarifying when an implementation may defer propogating the changes from `clUpdateMutableCommandsKHR`. I belive the only semantic implication of this is the removing the restriction > This is only possible with a command-buffer created with the CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR flag, as without this the enqueued command-buffer must complete before any modification occurs. So that implementations without simultaneous use support can still defer.
PR that covers point 1 only here for review #1315 |
* Clarify impl deferal of clUpdateMutableCommandsKHR Address point 1) of #1309 by clarifying when an implementation may defer propogating the changes from `clUpdateMutableCommandsKHR`. I belive the only semantic implication of this is the removing the restriction > This is only possible with a command-buffer created with the CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR flag, as without this the enqueued command-buffer must complete before any modification occurs. So that implementations without simultaneous use support can still defer. * Make change a NOTE
To summarize what I think the status of the 3 discussion points of this issue are:
|
In section 5.17.7 on Mutable Commands it is stated: "To facilitate performant usage for pipelined work flows, where applications repeatedly call command-buffer update then enqueue, implementations may defer some of the work to allow clUpdateMutableCommandsKHR to return immediately". What is the expectation from the implementation. Is clUpdateMutableCommandsKHR expect to synchronously update the command buffer?
clUpdateMutableCommandsKHR seems to be defined in a similar manner as clSetKernelArg. Is it not thread safe like clSetKernelArg? Clarification on how updates apply for simultaneous use required. If its not, we need to update Appendix A.
Apps may beneifit from a call such as clEnqueueCommandBufferWithUpdates(mutations to command buffer), which would enqueue a mutable command buffer and take addition arguments passed to clUpdateMutableCommandsKHR. The beneifit is updates and dispatch would be atomic. Any thoughts on this proposal?
The text was updated successfully, but these errors were encountered: