feature: disallow reset/signal calls on in-order Events

Related-To: NEO-8145

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-10-03 17:01:46 +00:00
committed by Compute-Runtime-Automation
parent 8042df8bb4
commit 1054d166e2
5 changed files with 29 additions and 29 deletions

View File

@@ -493,6 +493,10 @@ template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendEventReset(ze_event_handle_t hEvent) {
auto event = Event::fromHandle(hEvent);
if (event->isInOrderExecEvent()) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
NEO::Device *neoDevice = device->getNEODevice();
uint32_t callId = 0;
if (NEO::DebugManager.flags.EnableSWTags.get()) {

View File

@@ -386,10 +386,6 @@ void Event::setIsCompleted() {
unsetCmdQueue();
}
void Event::freeInOrderExecAllocation() {
inOrderExecInfo.reset();
}
void Event::updateInOrderExecState(std::shared_ptr<InOrderExecInfo> &newInOrderExecInfo, uint64_t signalValue, uint32_t allocationOffset) {
if (this->inOrderExecInfo.get() != newInOrderExecInfo.get()) {
inOrderExecInfo = newInOrderExecInfo;

View File

@@ -236,7 +236,6 @@ struct Event : _ze_event_handle_t {
Event(EventPool *eventPool, int index, Device *device) : device(device), eventPool(eventPool), index(index) {}
void unsetCmdQueue();
void freeInOrderExecAllocation();
uint64_t globalStartTS = 1;
uint64_t globalEndTS = 1;

View File

@@ -373,6 +373,10 @@ ze_result_t EventImp<TagSizeT>::hostEventSetValue(TagSizeT eventVal) {
template <typename TagSizeT>
ze_result_t EventImp<TagSizeT>::hostSignal() {
if (this->isInOrderExecEvent()) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
auto status = hostEventSetValue(Event::STATE_SIGNALED);
if (status == ZE_RESULT_SUCCESS) {
this->setIsCompleted();
@@ -467,6 +471,10 @@ ze_result_t EventImp<TagSizeT>::hostSynchronize(uint64_t timeout) {
template <typename TagSizeT>
ze_result_t EventImp<TagSizeT>::reset() {
if (this->isInOrderExecEvent()) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
if (NEO::DebugManager.flags.SynchronizeEventBeforeReset.get() != -1) {
if (NEO::DebugManager.flags.SynchronizeEventBeforeReset.get() == 2 && queryStatus() != ZE_RESULT_SUCCESS) {
printf("\nzeEventHostReset: Event %p not ready. Calling zeEventHostSynchronize.", this);
@@ -474,12 +482,7 @@ ze_result_t EventImp<TagSizeT>::reset() {
hostSynchronize(std::numeric_limits<uint64_t>::max());
}
if (inOrderExecEvent) {
freeInOrderExecAllocation();
inOrderExecSignalValue = 0;
inOrderAllocationOffset = 0;
}
unsetCmdQueue();
this->resetCompletionStatus();
this->resetDeviceCompletionData(false);