Skip to content

Commit 64c02c9

Browse files
fix: disallow signaling IPC imported CB Event
Related-To: NEO-11925 Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent 2b2bd19 commit 64c02c9

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3989,7 +3989,7 @@ bool CommandListCoreFamily<gfxCoreFamily>::handleCounterBasedEventOperations(Eve
39893989
}
39903990

39913991
if (signalEvent->isCounterBased()) {
3992-
if (!isInOrderExecutionEnabled()) {
3992+
if (!isInOrderExecutionEnabled() || signalEvent->isIpcImported()) {
39933993
return false;
39943994
}
39953995

level_zero/core/source/event/event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ struct Event : _ze_event_handle_t {
321321

322322
bool hasInOrderTimestampNode() const { return inOrderTimestampNode != nullptr; }
323323

324+
bool isIpcImported() const { return isFromIpcPool; }
325+
324326
protected:
325327
Event(int index, Device *device) : device(device), index(index) {}
326328

level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_3.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,25 @@ HWTEST2_F(InOrderIpcTests, givenTbxModeWhenOpenIsCalledThenSetAllocationParams,
232232
zeEventDestroy(newEvent);
233233
}
234234

235+
HWTEST2_F(InOrderIpcTests, givenIpcImportedEventWhenSignalingThenReturnError, MatchAny) {
236+
auto immCmdList = createImmCmdList<gfxCoreFamily>();
237+
238+
auto pool = createEvents<FamilyType>(1, false);
239+
240+
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, events[0]->toHandle(), 0, nullptr, launchParams, false);
241+
enableEventSharing(*events[0]);
242+
243+
IpcCounterBasedEventData ipcData = {};
244+
EXPECT_EQ(ZE_RESULT_SUCCESS, events[0]->getCounterBasedIpcHandle(ipcData));
245+
246+
ze_event_handle_t newEvent = nullptr;
247+
auto deviceH = device->toHandle();
248+
EXPECT_EQ(ZE_RESULT_SUCCESS, events[0]->openCounterBasedIpcHandle(ipcData, &newEvent, driverHandle.get(), context, 1, &deviceH));
249+
250+
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, newEvent, 0, nullptr, launchParams, false));
251+
252+
zeEventDestroy(newEvent);
253+
}
254+
235255
} // namespace ult
236256
} // namespace L0

0 commit comments

Comments
 (0)