SWDEV-444767 - Fix graph tests for context change between Inst & launch with DEBUG_CLR_GRAPH_PACKET_CAPTURE
When graph is Instantiate on device 0 graph and launch on device1 switch to command creation and enqueue during launch.
Change-Id: Ied34dc99b2a776130d1354ed3830c6ccab9068e4
[ROCm/clr commit: 7d09e1abed]
This commit is contained in:
@@ -356,6 +356,7 @@ hipError_t GraphExec::Init() {
|
||||
// For graph nodes capture AQL packets to dispatch them directly during graph launch.
|
||||
status = CaptureAQLPackets();
|
||||
}
|
||||
instantiateDeviceId_ = hip::getCurrentDevice()->deviceId();
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -589,7 +590,8 @@ hipError_t GraphExec::Run(hipStream_t stream) {
|
||||
repeatLaunch_ = true;
|
||||
}
|
||||
|
||||
if (parallelLists_.size() == 1) {
|
||||
if (parallelLists_.size() == 1 &&
|
||||
instantiateDeviceId_ == hip_stream->DeviceId()) {
|
||||
amd::AccumulateCommand* accumulate = nullptr;
|
||||
bool isLastPacketKernel = false;
|
||||
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||
@@ -631,6 +633,13 @@ hipError_t GraphExec::Run(hipStream_t stream) {
|
||||
accumulate->enqueue();
|
||||
accumulate->release();
|
||||
}
|
||||
} else if (parallelLists_.size() == 1 &&
|
||||
instantiateDeviceId_ != hip_stream->DeviceId()) {
|
||||
for (int i = 0; i < topoOrder_.size(); i++) {
|
||||
topoOrder_[i]->SetStream(hip_stream, this);
|
||||
status = topoOrder_[i]->CreateCommand(topoOrder_[i]->GetQueue());
|
||||
topoOrder_[i]->EnqueueCommands(stream);
|
||||
}
|
||||
} else {
|
||||
UpdateStream(parallelLists_, hip_stream, this);
|
||||
amd::Command* rootCommand = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user