-
Notifications
You must be signed in to change notification settings - Fork 124
Always use translated command-lists #1831
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
Closed
fabiomestre
wants to merge
2
commits into
oneapi-src:main
from
Bensuo:fabio/refactor_l0_cmd_buffer_part2
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,13 +431,11 @@ ur_result_t enqueueCommandBufferFillHelper( | |
| ur_exp_command_buffer_handle_t_::ur_exp_command_buffer_handle_t_( | ||
| ur_context_handle_t Context, ur_device_handle_t Device, | ||
| ze_command_list_handle_t CommandList, | ||
| ze_command_list_handle_t CommandListTranslated, | ||
| ze_command_list_handle_t CommandListResetEvents, | ||
| ze_command_list_handle_t CopyCommandList, ur_event_handle_t SignalEvent, | ||
| ur_event_handle_t WaitEvent, ur_event_handle_t AllResetEvent, | ||
| const ur_exp_command_buffer_desc_t *Desc, const bool IsInOrderCmdList) | ||
| : Context(Context), Device(Device), ZeComputeCommandList(CommandList), | ||
| ZeComputeCommandListTranslated(CommandListTranslated), | ||
| ZeCommandListResetEvents(CommandListResetEvents), | ||
| ZeCopyCommandList(CopyCommandList), SignalEvent(SignalEvent), | ||
| WaitEvent(WaitEvent), AllResetEvent(AllResetEvent), ZeFencesMap(), | ||
|
|
@@ -702,11 +700,16 @@ urCommandBufferCreateExp(ur_context_handle_t Context, ur_device_handle_t Device, | |
| (ZEL_HANDLE_COMMAND_LIST, ZeComputeCommandList, | ||
| (void **)&ZeComputeCommandListTranslated)); | ||
|
|
||
| ze_command_list_handle_t ZeCopyCommandListTranslated = nullptr; | ||
| ZE2UR_CALL(zelLoaderTranslateHandle, | ||
| (ZEL_HANDLE_COMMAND_LIST, ZeCopyCommandList, | ||
| (void **)&ZeCopyCommandListTranslated)); | ||
|
|
||
| try { | ||
| *CommandBuffer = new ur_exp_command_buffer_handle_t_( | ||
| Context, Device, ZeComputeCommandList, ZeComputeCommandListTranslated, | ||
| ZeCommandListResetEvents, ZeCopyCommandList, SignalEvent, WaitEvent, | ||
| AllResetEvent, CommandBufferDesc, IsInOrder); | ||
| Context, Device, ZeComputeCommandListTranslated, | ||
| ZeCommandListResetEvents, ZeCopyCommandListTranslated, SignalEvent, | ||
| WaitEvent, AllResetEvent, CommandBufferDesc, IsInOrder); | ||
| } catch (const std::bad_alloc &) { | ||
| return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; | ||
| } catch (...) { | ||
|
|
@@ -862,9 +865,9 @@ createCommandHandle(ur_exp_command_buffer_handle_t CommandBuffer, | |
| ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET; | ||
|
|
||
| auto Platform = CommandBuffer->Context->getPlatform(); | ||
| ZE2UR_CALL(Platform->ZeMutableCmdListExt.zexCommandListGetNextCommandIdExp, | ||
| (CommandBuffer->ZeComputeCommandListTranslated, | ||
| &ZeMutableCommandDesc, &CommandId)); | ||
| ZE2UR_CALL( | ||
| Platform->ZeMutableCmdListExt.zexCommandListGetNextCommandIdExp, | ||
| (CommandBuffer->ZeComputeCommandList, &ZeMutableCommandDesc, &CommandId)); | ||
| DEBUG_LOG(CommandId); | ||
|
|
||
| try { | ||
|
|
@@ -1754,7 +1757,7 @@ ur_result_t updateKernelCommand( | |
| auto Platform = CommandBuffer->Context->getPlatform(); | ||
| ZE2UR_CALL( | ||
| Platform->ZeMutableCmdListExt.zexCommandListUpdateMutableCommandsExp, | ||
| (CommandBuffer->ZeComputeCommandListTranslated, &MutableCommandDesc)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still need the translated compute command list handle. Any call to an extension function pointer requires all handles used are translated. |
||
| (CommandBuffer->ZeComputeCommandList, &MutableCommandDesc)); | ||
|
|
||
| return UR_RESULT_SUCCESS; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This will fail, you need to translate both handles, not just the copy above. This will break the code.