SWDEV-293816 - Only dispatch Counter Aql packet when it is created successfully.

Change-Id: Ic8a7374d19012754c6de5d483ec5d07a56661d1b


[ROCm/clr commit: 166ef6b622]
This commit is contained in:
jatang
2022-10-24 11:27:56 -04:00
committed by Jason Tang
parent 0d1d52d249
commit 53f289e0ac
@@ -3365,17 +3365,14 @@ void VirtualGPU::submitPerfCounter(amd::PerfCounterCommand& vcmd) {
if (!profileRef->initialize()) {
LogError("Failed to initialize performance counter");
vcmd.setStatus(CL_INVALID_OPERATION);
}
// create the AQL packet for start profiling
if (profileRef->createStartPacket() == nullptr) {
} else if (profileRef->createStartPacket() == nullptr) {
LogError("Failed to create AQL packet for start profiling");
vcmd.setStatus(CL_INVALID_OPERATION);
} else {
dispatchCounterAqlPacket(profileRef->prePacket(), counter->gfxVersion(), false,
profileRef->api());
}
dispatchCounterAqlPacket(profileRef->prePacket(), counter->gfxVersion(), false,
profileRef->api());
profileRef->release();
} else if (vcmd.getState() == amd::PerfCounterCommand::End) {
// Since all performance counters should use the same profile, use the 1st