SWDEV-314307 - hipStreamWaitEvent to wait on remote IPC events
Change-Id: Id97524ae9bc86d38376af2b0240f10d0dd5cc584
[ROCm/clr commit: bafc5bb30f]
Этот коммит содержится в:
@@ -332,7 +332,6 @@ endif()
|
||||
execute_process(COMMAND test ${CMAKE_INSTALL_PREFIX} -ef ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE INSTALL_SOURCE)
|
||||
if(NOT ${INSTALL_SOURCE} EQUAL 0)
|
||||
# Exclude .bat files on Linux.
|
||||
if(WIN32)
|
||||
install(DIRECTORY ${HIP_COMMON_BIN_DIR} DESTINATION . USE_SOURCE_PERMISSIONS)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@@ -347,6 +346,7 @@ if(NOT ${INSTALL_SOURCE} EQUAL 0)
|
||||
PATTERN "libamdhsacode" EXCLUDE)
|
||||
endif()
|
||||
else()
|
||||
# Exclude .bat files on Linux.
|
||||
install(DIRECTORY ${HIP_COMMON_BIN_DIR} DESTINATION . USE_SOURCE_PERMISSIONS
|
||||
PATTERN *.bat EXCLUDE)
|
||||
endif()
|
||||
|
||||
@@ -116,18 +116,18 @@ hipError_t IPCEvent::enqueueStreamWaitCommand(hipStream_t stream, amd::Command*
|
||||
|
||||
hipError_t IPCEvent::streamWait(hipStream_t stream, uint flags) {
|
||||
amd::HostQueue* queue = hip::getQueue(stream);
|
||||
// Access to event_ object must be lock protected
|
||||
|
||||
amd::ScopedLock lock(lock_);
|
||||
if ((event_ == nullptr) || (event_->command().queue() == queue) || ready()) {
|
||||
return hipSuccess;
|
||||
}
|
||||
amd::Command* command;
|
||||
hipError_t status = streamWaitCommand(command, queue);
|
||||
if (status != hipSuccess) {
|
||||
if(query() != hipSuccess) {
|
||||
amd::Command* command;
|
||||
hipError_t status = streamWaitCommand(command, queue);
|
||||
if (status != hipSuccess) {
|
||||
return status;
|
||||
}
|
||||
status = enqueueStreamWaitCommand(stream, command);
|
||||
return status;
|
||||
}
|
||||
status = enqueueStreamWaitCommand(stream, command);
|
||||
return status;
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
hipError_t IPCEvent::recordCommand(amd::Command*& command, amd::HostQueue* queue) {
|
||||
@@ -163,17 +163,8 @@ hipError_t IPCEvent::enqueueRecordCommand(hipStream_t stream, amd::Command* comm
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
command->enqueue();
|
||||
tEvent.notifyCmdQueue();
|
||||
|
||||
// Add the new barrier to stall the stream, until the callback is done
|
||||
amd::Command::EventWaitList eventWaitList;
|
||||
eventWaitList.push_back(command);
|
||||
amd::Command* block_command = new amd::Marker(*queue, !kMarkerDisableFlush, eventWaitList);
|
||||
if (block_command == nullptr) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
block_command->enqueue();
|
||||
block_command->release();
|
||||
// waiting for the call back to be called
|
||||
command->awaitCompletion();
|
||||
|
||||
// Update read index to indicate new signal.
|
||||
int expected = write_index - 1;
|
||||
|
||||
@@ -430,6 +430,7 @@ void WaitThenDecrementSignal(hipStream_t stream, hipError_t status, void* user_d
|
||||
int offset = data->previous_read_index % IPC_SIGNALS_PER_EVENT;
|
||||
while (data->shmem->read_index < data->previous_read_index + IPC_SIGNALS_PER_EVENT &&
|
||||
data->shmem->signal[offset] != 0) {
|
||||
amd::Os::sleep(1);
|
||||
}
|
||||
delete data;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user