fix: enable IPC event flag in zeGetIPCProperties

Related-To: NEO-16948

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
This commit is contained in:
Neil R. Spruit
2025-12-09 22:47:12 +00:00
committed by Compute-Runtime-Automation
parent fdb8d9efd1
commit 366ef91c23
3 changed files with 25 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ ze_result_t DriverHandleImp::getProperties(ze_driver_properties_t *properties) {
}
ze_result_t DriverHandleImp::getIPCProperties(ze_driver_ipc_properties_t *pIPCProperties) {
pIPCProperties->flags = ZE_IPC_PROPERTY_FLAG_MEMORY;
pIPCProperties->flags = ZE_IPC_PROPERTY_FLAG_MEMORY | ZE_IPC_PROPERTY_FLAG_EVENT_POOL;
return ZE_RESULT_SUCCESS;
}

View File

@@ -38,7 +38,18 @@ struct Mock<DriverHandle> : public DriverHandle {
ADDMETHOD_NOBASE(getProperties, ze_result_t, ZE_RESULT_SUCCESS, (ze_driver_properties_t * properties))
ADDMETHOD_NOBASE(getApiVersion, ze_result_t, ZE_RESULT_SUCCESS, (ze_api_version_t * version))
ADDMETHOD_NOBASE(getIPCProperties, ze_result_t, ZE_RESULT_SUCCESS, (ze_driver_ipc_properties_t * pIPCProperties))
ze_result_t getIPCPropertiesResult = ZE_RESULT_SUCCESS;
uint32_t getIPCPropertiesCalled = 0u;
bool callRealGetIPCProperties = false;
ze_result_t getIPCProperties(ze_driver_ipc_properties_t *pIPCProperties) override {
getIPCPropertiesCalled++;
if (callRealGetIPCProperties && getIPCPropertiesResult == ZE_RESULT_SUCCESS) {
return DriverHandleImp::getIPCProperties(pIPCProperties);
}
return getIPCPropertiesResult;
}
ADDMETHOD_NOBASE(importExternalPointer, ze_result_t, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, (void *ptr, size_t size))
ADDMETHOD_NOBASE(releaseImportedPointer, ze_result_t, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, (void *ptr))
ADDMETHOD_NOBASE(getHostPointerBaseAddress, ze_result_t, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, (void *ptr, void **baseAddress))

View File

@@ -1304,6 +1304,18 @@ TEST(zeDriverGetIpcProperties, whenZeDriverGetIpcPropertiesIsCalledThenGetIPCPro
EXPECT_EQ(1u, driverHandle.getIPCPropertiesCalled);
}
TEST(zeDriverGetIpcProperties, whenZeDriverGetIpcPropertiesSucceedsThenExpectedFlagsAreReturned) {
ze_result_t result = ZE_RESULT_SUCCESS;
Mock<DriverHandle> driverHandle;
driverHandle.callRealGetIPCProperties = true;
ze_driver_ipc_properties_t ipcProperties = {};
result = zeDriverGetIpcProperties(driverHandle.toHandle(), &ipcProperties);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(1u, driverHandle.getIPCPropertiesCalled);
EXPECT_EQ(static_cast<uint32_t>(ZE_IPC_PROPERTY_FLAG_MEMORY | ZE_IPC_PROPERTY_FLAG_EVENT_POOL), ipcProperties.flags);
}
struct HostImportApiFixture : public HostPointerManagerFixure {
void setUp() {
HostPointerManagerFixure::setUp();