SWDEV-303567 - Correct events for hipHccModuleLaunchKernel

Start event should be collected before the kernel launch.
End event can use the command from the kernel launch.

Change-Id: I5413c340280be680b15a44daa0c69b21ed314213
Этот коммит содержится в:
German Andryeyev
2021-10-19 00:01:41 -04:00
родитель 5f254dc780
Коммит 981508b2af
2 изменённых файлов: 18 добавлений и 13 удалений
+8
Просмотреть файл
@@ -98,6 +98,14 @@ class Event {
hipError_t recordCommand(amd::Command*& command, amd::HostQueue* queue);
hipError_t enqueueRecordCommand(hipStream_t stream, amd::Command* command, bool record);
hipError_t addMarker(hipStream_t stream, amd::Command* command, bool record);
void BindCommand(amd::Command& command) {
amd::ScopedLock lock(lock_);
if (event_ != nullptr) {
event_->release();
}
event_ = &command.event();
command.retain();
}
bool isRecorded() { return recorded_; }
amd::Monitor& lock() { return lock_; }
+10 -13
Просмотреть файл
@@ -388,22 +388,19 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
return status;
}
hip::Event* eStart = reinterpret_cast<hip::Event*>(startEvent);
hip::Event* eStop = reinterpret_cast<hip::Event*>(stopEvent);
command->enqueue();
if (startEvent != nullptr) {
status = eStart->addMarker(hStream, command, false);
command->retain();
}
if (status != hipSuccess) {
return status;
hip::Event* eStart = reinterpret_cast<hip::Event*>(startEvent);
status = eStart->addMarker(hStream, nullptr, false);
if (status != hipSuccess) {
return status;
}
}
command->enqueue();
if (stopEvent != nullptr) {
status = eStop->addMarker(hStream, command, true);
command->retain();
}
if (status != hipSuccess) {
return status;
hip::Event* eStop = reinterpret_cast<hip::Event*>(stopEvent);
eStop->BindCommand(*command);
}
command->release();