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
Этот коммит содержится в:
@@ -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_; }
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user