[L0v2] fix queues for integrated buffers#21318
Conversation
pbalcer
left a comment
There was a problem hiding this comment.
Consider also if we can't optionally move signaling the event into the migrate memory function.
| if (!cmdList) { | ||
| UR_DFAILURE("invalid handle in mapHostPtr"); | ||
| throw UR_RESULT_ERROR_INVALID_NULL_HANDLE; | ||
| } | ||
| // Use Level Zero copy for USM HOST memory to ensure GPU visibility | ||
| ZE_CALL_NOCHECK(zeCommandListAppendMemoryCopy, | ||
| (cmdList, mappedPtr, ur_cast<char *>(ptr.get()) + offset, | ||
| mapSize, nullptr, 0, nullptr)); | ||
| ZE2UR_CALL_THROWS(zeCommandListAppendMemoryCopy, | ||
| (cmdList, mappedPtr, | ||
| ur_cast<char *>(ptr.get()) + offset, mapSize, nullptr, | ||
| waitListView.num, waitListView.handles)); | ||
| waitListView.clear(); |
There was a problem hiding this comment.
at this point, can't we just call the migrateMemory function?
|
|
||
| if (mappedRegion->flags & | ||
| (UR_MAP_FLAG_WRITE | UR_MAP_FLAG_WRITE_INVALIDATE_REGION)) { | ||
| if (!cmdList) { |
| void ur_integrated_buffer_handle_t::unmapHostPtr( | ||
| void *pMappedPtr, ze_command_list_handle_t cmdList, | ||
| wait_list_view & /*waitListView*/) { | ||
| wait_list_view &waitListView) { |
There was a problem hiding this comment.
This wait list will always be empty:
If we want to do this, we'd need to invert how the parameters are passed here. But, given the TODO comment in that function, I'm not sure if that's the right thing to do. Would require some investigation.
| void *ur_integrated_buffer_handle_t::mapHostPtr( | ||
| ur_map_flags_t flags, size_t offset, size_t mapSize, | ||
| ze_command_list_handle_t cmdList, wait_list_view & /*waitListView*/) { | ||
| ze_command_list_handle_t cmdList, wait_list_view &waitListView) { |
There was a problem hiding this comment.
Without changing the map function, this wait list will now be used twice, see:
llvm/unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp
Lines 746 to 755 in e7b423f
This is an update of #21297, making the changes consistent with migrateMemory()