feature: Experimental support of immediate cmd list in-order execution [1/n]

Related-To: LOCI-4332

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-04-26 11:48:10 +00:00
committed by Compute-Runtime-Automation
parent e35a7746a4
commit 14c3777409
11 changed files with 159 additions and 0 deletions

View File

@@ -24,6 +24,7 @@
#include "shared/source/utilities/wait_util.h"
#include "level_zero/core/source/cmdlist/cmdlist.h"
#include "level_zero/core/source/cmdlist/cmdlist_imp.h"
#include "level_zero/core/source/cmdqueue/cmdqueue.h"
#include "level_zero/core/source/context/context_imp.h"
#include "level_zero/core/source/device/device.h"
@@ -334,6 +335,10 @@ ze_result_t EventPool::openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t &
}
ze_result_t Event::destroy() {
if (latestUsedInOrderCmdList) {
latestUsedInOrderCmdList->unsetLastInOrderOutEvent(this->toHandle());
}
delete this;
return ZE_RESULT_SUCCESS;
}

View File

@@ -39,6 +39,7 @@ struct DriverHandle;
struct DriverHandleImp;
struct Device;
struct Kernel;
struct CommandListImp;
#pragma pack(1)
struct IpcEventPoolData {
@@ -200,6 +201,10 @@ struct Event : _ze_event_handle_t {
this->metricStreamer = metricStreamer;
}
void setLatestUsedInOrderCmdList(CommandListImp *newCmdList) {
latestUsedInOrderCmdList = newCmdList;
}
protected:
Event(EventPool *eventPool, int index, Device *device) : device(device), eventPool(eventPool), index(index) {}
@@ -230,6 +235,7 @@ struct Event : _ze_event_handle_t {
Device *device = nullptr;
EventPool *eventPool = nullptr;
Kernel *kernelWithPrintf = nullptr;
CommandListImp *latestUsedInOrderCmdList = nullptr;
uint32_t maxKernelCount = 0;
uint32_t kernelCount = 1u;

View File

@@ -346,6 +346,10 @@ ze_result_t EventImp<TagSizeT>::hostSynchronize(uint64_t timeout) {
template <typename TagSizeT>
ze_result_t EventImp<TagSizeT>::reset() {
if (latestUsedInOrderCmdList) {
latestUsedInOrderCmdList->unsetLastInOrderOutEvent(this->toHandle());
latestUsedInOrderCmdList = nullptr;
}
this->resetCompletionStatus();
this->resetDeviceCompletionData(false);
this->l3FlushAppliedOnKernel.reset();