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
Este commit está contenido en:
@@ -42,7 +42,9 @@ inline hipError_t ihipGraphUpload(hipGraphExec_t graphExec, hipStream_t stream)
|
||||
if (!hip::isValid(stream)) {
|
||||
return hipErrorContextIsDestroyed;
|
||||
}
|
||||
|
||||
if (!hip::GraphExec::isGraphExecValid(reinterpret_cast<hip::GraphExec*>(graphExec))) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -569,6 +569,7 @@ struct GraphExec {
|
||||
std::vector<address> kernarg_graph_;
|
||||
uint32_t kernarg_graph_cur_offset_ = 0;
|
||||
uint32_t kernarg_graph_size_ = 128 * Ki;
|
||||
int instantiateDeviceId_ = -1;
|
||||
|
||||
public:
|
||||
GraphExec(std::vector<Node>& topoOrder, std::vector<std::vector<Node>>& lists,
|
||||
|
||||
Referencia en una nueva incidencia
Block a user