feature: handling in-order Event wait from different Regular CmdList

Related-To: NEO-8145

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-10-03 09:34:45 +00:00
committed by Compute-Runtime-Automation
parent 110164a52a
commit 135b227c9b
8 changed files with 192 additions and 24 deletions

View File

@@ -11,6 +11,7 @@
#include "shared/source/helpers/ptr_math.h"
#include <cstdint>
#include <memory>
#include <vector>
namespace NEO {
@@ -52,7 +53,12 @@ enum class PatchCmdType {
template <typename GfxFamily>
struct PatchCmd {
PatchCmd(void *cmd, uint64_t baseCounterValue, PatchCmdType patchCmdType) : cmd(cmd), baseCounterValue(baseCounterValue), patchCmdType(patchCmdType) {}
PatchCmd(std::shared_ptr<InOrderExecInfo> *inOrderExecInfo, void *cmd, uint64_t baseCounterValue, PatchCmdType patchCmdType)
: cmd(cmd), baseCounterValue(baseCounterValue), patchCmdType(patchCmdType) {
if (inOrderExecInfo) {
this->inOrderExecInfo = *inOrderExecInfo;
}
}
void patch(uint64_t appendCunterValue) {
switch (patchCmdType) {
@@ -71,6 +77,9 @@ struct PatchCmd {
}
}
bool isExternalDependency() const { return inOrderExecInfo.get(); }
std::shared_ptr<InOrderExecInfo> inOrderExecInfo;
void *cmd = nullptr;
const uint64_t baseCounterValue = 0;
const PatchCmdType patchCmdType = PatchCmdType::None;
@@ -83,6 +92,13 @@ struct PatchCmd {
}
void patchSemaphore(uint64_t appendCunterValue) {
if (isExternalDependency()) {
appendCunterValue = InOrderPatchCommandHelpers::getAppendCounterValue(*inOrderExecInfo);
if (appendCunterValue == 0) {
return;
}
}
auto semaphoreCmd = reinterpret_cast<typename GfxFamily::MI_SEMAPHORE_WAIT *>(cmd);
semaphoreCmd->setSemaphoreDataDword(static_cast<uint32_t>(baseCounterValue + appendCunterValue));
}