From b28fc0f55d92bac7403c38c222d5759e312c0610 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Tue, 18 Jun 2024 13:04:32 +0000 Subject: [PATCH] feature: report copy offload extension Related-To: NEO-11376 Signed-off-by: Bartosz Dunajski --- level_zero/core/source/driver/driver_handle_imp.cpp | 6 +++++- .../core/test/unit_tests/sources/driver/test_driver.cpp | 4 ++++ level_zero/include/ze_intel_gpu.h | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index bec68d4cb1..86146f9741 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -149,7 +149,7 @@ ze_result_t DriverHandleImp::getExtensionProperties(uint32_t *pCount, for (const auto device : devices) { if (device->getNEODevice()->getRootDeviceEnvironment().getBindlessHeapsHelper()) { - additionalExtensions.push_back({ZE_BINDLESS_IMAGE_EXP_NAME, ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT}); + additionalExtensions.emplace_back(ZE_BINDLESS_IMAGE_EXP_NAME, ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT); break; } } @@ -159,6 +159,10 @@ ze_result_t DriverHandleImp::getExtensionProperties(uint32_t *pCount, additionalExtensions.emplace_back(ZE_SYNCHRONIZED_DISPATCH_EXP_NAME, ZE_SYNCHRONIZED_DISPATCH_EXP_VERSION_CURRENT); } + if (!devices[0]->getProductHelper().isDcFlushAllowed()) { + additionalExtensions.emplace_back(ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_NAME, ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_CURRENT); + } + auto extensionCount = static_cast(this->extensionsSupported.size() + additionalExtensions.size()); if (nullptr == pExtensionProperties) { diff --git a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp index da5e956d17..89080aaf19 100644 --- a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp @@ -122,6 +122,10 @@ TEST_F(DriverVersionTest, givenCallToGetExtensionPropertiesThenSupportedExtensio additionalExtensions.emplace_back(ZE_SYNCHRONIZED_DISPATCH_EXP_NAME, ZE_SYNCHRONIZED_DISPATCH_EXP_VERSION_CURRENT); } + if (!device->getProductHelper().isDcFlushAllowed()) { + additionalExtensions.emplace_back(ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_NAME, ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_CURRENT); + } + uint32_t count = 0; ze_result_t res = driverHandle->getExtensionProperties(&count, nullptr); EXPECT_EQ(count, static_cast(driverHandle->extensionsSupported.size() + additionalExtensions.size())); diff --git a/level_zero/include/ze_intel_gpu.h b/level_zero/include/ze_intel_gpu.h index d2c8d67a1c..d1fc8dd10a 100644 --- a/level_zero/include/ze_intel_gpu.h +++ b/level_zero/include/ze_intel_gpu.h @@ -177,6 +177,14 @@ typedef struct _zex_intel_queue_copy_operations_offload_hint_exp_desc_t { #define ZEX_INTEL_STRUCTURE_TYPE_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_PROPERTIES (ze_structure_type_t)0x00030019 +/////////////////////////////////////////////////////////////////////////////// +/// @brief Queue copy operations offload hint extension version(s) +typedef enum _zex_intel_queue_copy_operations_offload_hint_exp_version_t { + ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION(1, 0), ///< version 1.0 + ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION(1, 0), ///< latest known version + ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff +} zex_intel_queue_copy_operations_offload_hint_exp_version_t; + #if defined(__cplusplus) } // extern "C" #endif