From 85579805faa76d3a7c627db8a183733726e0b67f Mon Sep 17 00:00:00 2001 From: "Zhu, Shaojie" Date: Thu, 10 Oct 2024 11:13:26 +0800 Subject: [PATCH] Modify the inline function throwOnFail to a macro THROW_ON_FAIL_FOR_BACKEND --- .../src/backend/include/zero_utils.hpp | 46 ++++------- .../intel_npu/src/backend/src/zero_device.cpp | 30 ++++--- .../src/backend/src/zero_executor.cpp | 18 ++-- .../src/backend/src/zero_infer_request.cpp | 4 +- .../intel_npu/src/backend/src/zero_init.cpp | 32 ++++---- .../src/backend/src/zero_profiling.cpp | 35 ++++---- .../src/backend/src/zero_remote_tensor.cpp | 26 +++--- .../src/backend/src/zero_wrappers.cpp | 82 ++++++++++--------- .../compiler/src/zero_compiler_in_driver.cpp | 80 ++++++++---------- 9 files changed, 171 insertions(+), 182 deletions(-) diff --git a/src/plugins/intel_npu/src/backend/include/zero_utils.hpp b/src/plugins/intel_npu/src/backend/include/zero_utils.hpp index 41466c5e6b9fe5..73de78cb2c3cc2 100644 --- a/src/plugins/intel_npu/src/backend/include/zero_utils.hpp +++ b/src/plugins/intel_npu/src/backend/include/zero_utils.hpp @@ -18,7 +18,7 @@ namespace intel_npu { namespace zeroUtils { -#define THROW_ON_FAIL(step, result, graph_ddi_table_ext) \ +#define THROW_ON_FAIL_FOR_GRAPH_EXT(step, result, graph_ddi_table_ext) \ OPENVINO_THROW("L0 ", \ step, \ " result: ", \ @@ -31,18 +31,17 @@ namespace zeroUtils { " . ", \ intel_npu::zeroUtils::getLatestBuildError(graph_ddi_table_ext)); -static inline void throwOnFail(const std::string& step, const ze_result_t result) { - if (ZE_RESULT_SUCCESS != result) { - OPENVINO_THROW("L0 ", - step, - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result), - " - ", - ze_result_to_description(result)); - } +#define THROW_ON_FAIL_FOR_BACKEND(step, result) \ +if (ZE_RESULT_SUCCESS != result) { \ + OPENVINO_THROW("L0 ", \ + step, \ + " result: ", \ + ze_result_to_string(result), \ + ", code 0x", \ + std::hex, \ + uint64_t(result), \ + " - ", \ + ze_result_to_description(result)); \ } static inline void throwOnFail(const std::string& step, const ze_result_t result, const std::string& hintOnError) { @@ -230,31 +229,14 @@ static inline uint32_t findGroupOrdinal( return 0; } -#define NotSupportLogHandle(T) \ - (std::is_same::value || std::is_same::value) - static inline std::string getLatestBuildError(ze_graph_dditable_ext_curr_t& _graph_ddi_table_ext) { Logger _logger("LevelZeroUtils", Logger::global().level()); _logger.debug("getLatestBuildError start"); uint32_t graphDdiExtVersion = _graph_ddi_table_ext.version(); bool ifNotSupportLogHandle = true; - switch (graphDdiExtVersion) { - case ZE_GRAPH_EXT_VERSION_1_3: - ifNotSupportLogHandle = NotSupportLogHandle(ze_graph_dditable_ext_1_3_t); - break; - case ZE_GRAPH_EXT_VERSION_1_4: - ifNotSupportLogHandle = NotSupportLogHandle(ze_graph_dditable_ext_1_4_t); - break; - case ZE_GRAPH_EXT_VERSION_1_5: - ifNotSupportLogHandle = NotSupportLogHandle(ze_graph_dditable_ext_1_5_t); - break; - case ZE_GRAPH_EXT_VERSION_1_6: - ifNotSupportLogHandle = NotSupportLogHandle(ze_graph_dditable_ext_1_6_t); - break; - default: - ifNotSupportLogHandle = NotSupportLogHandle(ze_graph_dditable_ext_1_2_t); - break; + if (graphDdiExtVersion >= ZE_GRAPH_EXT_VERSION_1_4) { + ifNotSupportLogHandle = false; } if (ifNotSupportLogHandle) { diff --git a/src/plugins/intel_npu/src/backend/src/zero_device.cpp b/src/plugins/intel_npu/src/backend/src/zero_device.cpp index 2df37a59ae1d27..ff86f4da3d8a62 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_device.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_device.cpp @@ -20,8 +20,8 @@ ZeroDevice::ZeroDevice(const std::shared_ptr& initStructs log("ZeroDevice", Logger::global().level()) { log.debug("ZeroDevice::ZeroDevice init"); device_properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES; - zeroUtils::throwOnFail("zeDeviceGetProperties", - zeDeviceGetProperties(_initStructs->getDevice(), &device_properties)); + THROW_ON_FAIL_FOR_BACKEND("zeDeviceGetProperties", + zeDeviceGetProperties(_initStructs->getDevice(), &device_properties)); // Query PCI information // Older drivers do not have this implementend. Linux driver returns NOT_IMPLEMENTED, while windows driver returns @@ -62,7 +62,7 @@ ZeroDevice::ZeroDevice(const std::shared_ptr& initStructs std::vector command_group_properties; uint32_t command_queue_group_count = 0; // Discover all command queue groups - zeroUtils::throwOnFail( + THROW_ON_FAIL_FOR_BACKEND( "zeDeviceGetCommandQueueGroupProperties", zeDeviceGetCommandQueueGroupProperties(_initStructs->getDevice(), &command_queue_group_count, nullptr)); @@ -74,10 +74,10 @@ ZeroDevice::ZeroDevice(const std::shared_ptr& initStructs prop.pNext = nullptr; } - zeroUtils::throwOnFail("zeDeviceGetCommandQueueGroupProperties", - zeDeviceGetCommandQueueGroupProperties(_initStructs->getDevice(), - &command_queue_group_count, - command_group_properties.data())); + THROW_ON_FAIL_FOR_BACKEND("zeDeviceGetCommandQueueGroupProperties", + zeDeviceGetCommandQueueGroupProperties(_initStructs->getDevice(), + &command_queue_group_count, + command_group_properties.data())); // Find the corresponding command queue group. log.debug("ZeroDevice::ZeroDevice - findGroupOrdinal"); @@ -138,17 +138,21 @@ uint32_t ZeroDevice::getMaxNumSlices() const { uint64_t ZeroDevice::getAllocMemSize() const { ze_graph_memory_query_t query{}; - zeroUtils::throwOnFail( - "pfnQueryContextMemory", - _graph_ddi_table_ext.pfnQueryContextMemory(_initStructs->getContext(), ZE_GRAPH_QUERY_MEMORY_DDR, &query)); + ze_result_t result = + _graph_ddi_table_ext.pfnQueryContextMemory(_initStructs->getContext(), ZE_GRAPH_QUERY_MEMORY_DDR, &query); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnQueryContextMemory", result, _graph_ddi_table_ext); + } return query.allocated; } uint64_t ZeroDevice::getTotalMemSize() const { ze_graph_memory_query_t query{}; - zeroUtils::throwOnFail( - "pfnQueryContextMemory", - _graph_ddi_table_ext.pfnQueryContextMemory(_initStructs->getContext(), ZE_GRAPH_QUERY_MEMORY_DDR, &query)); + ze_result_t result = + _graph_ddi_table_ext.pfnQueryContextMemory(_initStructs->getContext(), ZE_GRAPH_QUERY_MEMORY_DDR, &query); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnQueryContextMemory", result, _graph_ddi_table_ext); + } return query.total; } diff --git a/src/plugins/intel_npu/src/backend/src/zero_executor.cpp b/src/plugins/intel_npu/src/backend/src/zero_executor.cpp index b62b7bfda8933c..2dd74c639a9d76 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_executor.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_executor.cpp @@ -53,7 +53,7 @@ ZeroExecutor::ZeroExecutor(const std::shared_ptr& i ze_result_t result = _graph_ddi_table_ext.pfnCreate(_initStructs->getContext(), _initStructs->getDevice(), &desc, &_graph); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnCreate", result, _graph_ddi_table_ext); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnCreate", result, _graph_ddi_table_ext); } } else { @@ -66,7 +66,10 @@ ZeroExecutor::ZeroExecutor(const std::shared_ptr& i ze_graph_properties_t props{}; props.stype = ZE_STRUCTURE_TYPE_GRAPH_PROPERTIES; - zeroUtils::throwOnFail("pfnGetProperties", _graph_ddi_table_ext.pfnGetProperties(_graph, &props)); + ze_result_t result = _graph_ddi_table_ext.pfnGetProperties(_graph, &props); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetProperties", result, _graph_ddi_table_ext); + } auto targetDriverExtVersion = _graph_ddi_table_ext.version(); if (targetDriverExtVersion <= ZE_GRAPH_EXT_VERSION_1_1) { OPENVINO_THROW("Incompatibility between the NPU plugin and driver! The driver version is too old, please " @@ -78,8 +81,10 @@ ZeroExecutor::ZeroExecutor(const std::shared_ptr& i for (uint32_t index = 0; index < props.numGraphArgs; ++index) { ze_graph_argument_properties_3_t arg3{}; arg3.stype = ZE_STRUCTURE_TYPE_GRAPH_ARGUMENT_PROPERTIES; - zeroUtils::throwOnFail("pfnGetArgumentProperties3", - _graph_ddi_table_ext.pfnGetArgumentProperties3(_graph, index, &arg3)); + ze_result_t result = _graph_ddi_table_ext.pfnGetArgumentProperties3(_graph, index, &arg3); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetArgumentProperties3", result, _graph_ddi_table_ext); + } if (arg3.type == ZE_GRAPH_ARGUMENT_TYPE_INPUT) { _input_descriptors.push_back(ArgumentDescriptor{arg3, index}); @@ -164,7 +169,10 @@ void ZeroExecutor::setWorkloadType(const ov::WorkloadType workloadType) const { } void ZeroExecutor::setArgumentValue(uint32_t argi_, const void* argv_) const { - zeroUtils::throwOnFail("zeGraphSetArgumentValue", _graph_ddi_table_ext.pfnSetArgumentValue(_graph, argi_, argv_)); + ze_result_t result = _graph_ddi_table_ext.pfnSetArgumentValue(_graph, argi_, argv_); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("zeGraphSetArgumentValue", result, _graph_ddi_table_ext); + } } void ZeroExecutor::mutexLock() const { diff --git a/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp b/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp index 2c954151a4f652..c5c0de852c289b 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp @@ -188,8 +188,8 @@ ZeroInferRequest::ZeroInferRequest(const std::shared_ptr& } _properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES; - zeroUtils::throwOnFail("zeDeviceGetProperties", - zeDeviceGetProperties(_executor->getInitStructs()->getDevice(), &_properties)); + THROW_ON_FAIL_FOR_BACKEND("zeDeviceGetProperties", + zeDeviceGetProperties(_executor->getInitStructs()->getDevice(), &_properties)); _outputAllocator = std::make_shared(_initStructs); _inputAllocator = diff --git a/src/plugins/intel_npu/src/backend/src/zero_init.cpp b/src/plugins/intel_npu/src/backend/src/zero_init.cpp index 39d0613ec64daa..e09f31a3f6c4b3 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_init.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_init.cpp @@ -54,13 +54,13 @@ static std::tuple queryDriverExtensionVersion( ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", Logger::global().level()) { OV_ITT_SCOPED_TASK(itt::domains::LevelZeroBackend, "ZeroInitStructsHolder::ZeroInitStructsHolder"); log.debug("ZeroInitStructsHolder - performing zeInit on VPU only"); - zeroUtils::throwOnFail("zeInit", zeInit(ZE_INIT_FLAG_VPU_ONLY)); + THROW_ON_FAIL_FOR_BACKEND("zeInit", zeInit(ZE_INIT_FLAG_VPU_ONLY)); uint32_t drivers = 0; - zeroUtils::throwOnFail("zeDriverGet", zeDriverGet(&drivers, nullptr)); + THROW_ON_FAIL_FOR_BACKEND("zeDriverGet", zeDriverGet(&drivers, nullptr)); std::vector all_drivers(drivers); - zeroUtils::throwOnFail("zeDriverGet", zeDriverGet(&drivers, all_drivers.data())); + THROW_ON_FAIL_FOR_BACKEND("zeDriverGet", zeDriverGet(&drivers, all_drivers.data())); // Get our target driver driver_properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; @@ -79,7 +79,7 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", // Check L0 API version ze_api_version_t ze_drv_api_version = {}; - zeroUtils::throwOnFail("zeDriverGetApiVersion", zeDriverGetApiVersion(driver_handle, &ze_drv_api_version)); + THROW_ON_FAIL_FOR_BACKEND("zeDriverGetApiVersion", zeDriverGetApiVersion(driver_handle, &ze_drv_api_version)); if (ZE_MAJOR_VERSION(ZE_API_VERSION_CURRENT) != ZE_MAJOR_VERSION(ze_drv_api_version)) { OPENVINO_THROW("Incompatibility between NPU plugin and driver! ", @@ -97,13 +97,13 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", } uint32_t count = 0; - zeroUtils::throwOnFail("zeDriverGetExtensionProperties", - zeDriverGetExtensionProperties(driver_handle, &count, nullptr)); + THROW_ON_FAIL_FOR_BACKEND("zeDriverGetExtensionProperties", + zeDriverGetExtensionProperties(driver_handle, &count, nullptr)); std::vector extProps; extProps.resize(count); - zeroUtils::throwOnFail("zeDriverGetExtensionProperties", - zeDriverGetExtensionProperties(driver_handle, &count, extProps.data())); + THROW_ON_FAIL_FOR_BACKEND("zeDriverGetExtensionProperties", + zeDriverGetExtensionProperties(driver_handle, &count, extProps.data())); // Query our graph extension version std::string graph_ext_name; @@ -148,7 +148,7 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", // Load our command queue extension ze_command_queue_npu_dditable_ext_last_t* _command_queue_npu_dditable_ext = nullptr; if (command_queue_ext_version) { - zeroUtils::throwOnFail( + THROW_ON_FAIL_FOR_BACKEND( "zeDriverGetExtensionFunctionAddress " + command_queue_ext_name, zeDriverGetExtensionFunctionAddress(driver_handle, command_queue_ext_name.c_str(), @@ -161,10 +161,10 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", // Load our graph extension ze_graph_dditable_ext_last_t* graph_ddi_table_ext = nullptr; - zeroUtils::throwOnFail("zeDriverGetExtensionFunctionAddress", - zeDriverGetExtensionFunctionAddress(driver_handle, - graph_ext_name.c_str(), - reinterpret_cast(&graph_ddi_table_ext))); + THROW_ON_FAIL_FOR_BACKEND("zeDriverGetExtensionFunctionAddress", + zeDriverGetExtensionFunctionAddress(driver_handle, + graph_ext_name.c_str(), + reinterpret_cast(&graph_ddi_table_ext))); graph_dditable_ext_decorator = std::make_unique(graph_ddi_table_ext, graph_ext_version); @@ -189,7 +189,7 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", // Load our profiling extension ze_graph_profiling_dditable_ext_t* _graph_profiling_ddi_table_ext = nullptr; - zeroUtils::throwOnFail( + THROW_ON_FAIL_FOR_BACKEND( "zeDriverGetExtensionFunctionAddress", zeDriverGetExtensionFunctionAddress(driver_handle, "ZE_extension_profiling_data", @@ -200,11 +200,11 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder", uint32_t device_count = 1; // Get our target device - zeroUtils::throwOnFail("zeDeviceGet", zeDeviceGet(driver_handle, &device_count, &device_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeDeviceGet", zeDeviceGet(driver_handle, &device_count, &device_handle)); // Create context - share between the compiler and the backend ze_context_desc_t context_desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, 0, 0}; - zeroUtils::throwOnFail("zeContextCreate", zeContextCreate(driver_handle, &context_desc, &context)); + THROW_ON_FAIL_FOR_BACKEND("zeContextCreate", zeContextCreate(driver_handle, &context_desc, &context)); log.debug("ZeroInitStructsHolder initialize complete"); } diff --git a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp index a99c9315b74cdb..156122b737bb53 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp @@ -46,8 +46,8 @@ ProfilingPool::~ProfilingPool() { } void ProfilingQuery::create(const ze_graph_profiling_pool_handle_t& profiling_pool) { - zeroUtils::throwOnFail("pfnProfilingQueryCreate", - _graph_profiling_ddi_table_ext.pfnProfilingQueryCreate(profiling_pool, _index, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("pfnProfilingQueryCreate", + _graph_profiling_ddi_table_ext.pfnProfilingQueryCreate(profiling_pool, _index, &_handle)); } LayerStatistics ProfilingQuery::getLayerStatistics() const { @@ -66,7 +66,7 @@ void ProfilingQuery::queryGetData(const ze_graph_profiling_type_t profilingType, uint32_t* pSize, uint8_t* pData) const { if (_handle && pSize) { - zeroUtils::throwOnFail( + THROW_ON_FAIL_FOR_BACKEND( "pfnProfilingQueryGetData", _graph_profiling_ddi_table_ext.pfnProfilingQueryGetData(_handle, profilingType, pSize, pData)); } @@ -92,7 +92,7 @@ template std::vector ProfilingQuery::getData() const; void ProfilingQuery::getProfilingProperties(ze_device_profiling_data_properties_t* properties) const { if (_handle && properties) { - zeroUtils::throwOnFail( + THROW_ON_FAIL_FOR_BACKEND( "getProfilingProperties", _graph_profiling_ddi_table_ext.pfnDeviceGetProfilingDataProperties(_device_handle, properties)); } @@ -187,23 +187,24 @@ NpuInferProfiling::NpuInferProfiling(ze_context_handle_t context, _logger("InferProfiling", loglevel) { /// Fetch and store the device timer resolution _dev_properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2; - zeroUtils::throwOnFail("zeDeviceGetProperties", zeDeviceGetProperties(_device_handle, &_dev_properties)); + THROW_ON_FAIL_FOR_BACKEND("zeDeviceGetProperties", zeDeviceGetProperties(_device_handle, &_dev_properties)); /// Request mem allocations ze_host_mem_alloc_desc_t desc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC, nullptr, ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED}; - zeroUtils::throwOnFail("zeMemAllocHost", - zeMemAllocHost(_context, - &desc, - sizeof(uint64_t), - 64, - &npu_ts_infer_start)); // align to 64 bytes to match npu l2 cache line size - zeroUtils::throwOnFail("zeMemAllocHost", - zeMemAllocHost(_context, - &desc, - sizeof(uint64_t), - 64, - &npu_ts_infer_end)); // alight to 64 bytes to match npu l2 cache line size + THROW_ON_FAIL_FOR_BACKEND( + "zeMemAllocHost", + zeMemAllocHost(_context, + &desc, + sizeof(uint64_t), + 64, + &npu_ts_infer_start)); // align to 64 bytes to match npu l2 cache line size + THROW_ON_FAIL_FOR_BACKEND("zeMemAllocHost", + zeMemAllocHost(_context, + &desc, + sizeof(uint64_t), + 64, + &npu_ts_infer_end)); // alight to 64 bytes to match npu l2 cache line size } void NpuInferProfiling::sampleNpuTimestamps() { diff --git a/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp b/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp index e47b454e11c427..1a151bfd19004c 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp @@ -37,7 +37,8 @@ ZeroRemoteTensor::ZeroRemoteTensor(std::shared_ptr context, _mem_type(mem_type), _mem(mem) { _ze_properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES; - zeroUtils::throwOnFail("zeDeviceGetProperties", zeDeviceGetProperties(_init_structs->getDevice(), &_ze_properties)); + THROW_ON_FAIL_FOR_BACKEND("zeDeviceGetProperties", + zeDeviceGetProperties(_init_structs->getDevice(), &_ze_properties)); const auto byte_size = ov::element::get_memory_size(_element_type, shape_size(_shape)); @@ -97,8 +98,8 @@ void ZeroRemoteTensor::allocate(const size_t bytes) { } else { desc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC, nullptr, 0}; } - zeroUtils::throwOnFail("zeMemAllocHost", - zeMemAllocHost(_init_structs->getContext(), &desc, size, STANDARD_PAGE_SIZE, &_data)); + THROW_ON_FAIL_FOR_BACKEND("zeMemAllocHost", + zeMemAllocHost(_init_structs->getContext(), &desc, size, STANDARD_PAGE_SIZE, &_data)); break; } case MemType::SHARED_BUF: { @@ -116,13 +117,13 @@ void ZeroRemoteTensor::allocate(const size_t bytes) { _mem, nullptr}; ze_device_mem_alloc_desc_t desc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC, &memory_import, 0, 0}; - zeroUtils::throwOnFail("zeMemAllocDevice", - zeMemAllocDevice(_init_structs->getContext(), - &desc, - bytes, - STANDARD_PAGE_SIZE, - _init_structs->getDevice(), - &_data)); + THROW_ON_FAIL_FOR_BACKEND("zeMemAllocDevice", + zeMemAllocDevice(_init_structs->getContext(), + &desc, + bytes, + STANDARD_PAGE_SIZE, + _init_structs->getDevice(), + &_data)); #else // in the case of Linux platforms memory could be changed after allocation - using zeMemAllocHost for importing // memory @@ -131,8 +132,9 @@ void ZeroRemoteTensor::allocate(const size_t bytes) { ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF, static_cast(reinterpret_cast(_mem))}; ze_host_mem_alloc_desc_t desc = {.pNext = &memory_import}; - zeroUtils::throwOnFail("zeMemAllocHost", - zeMemAllocHost(_init_structs->getContext(), &desc, bytes, STANDARD_PAGE_SIZE, &_data)); + THROW_ON_FAIL_FOR_BACKEND( + "zeMemAllocHost", + zeMemAllocHost(_init_structs->getContext(), &desc, bytes, STANDARD_PAGE_SIZE, &_data)); #endif break; } diff --git a/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp b/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp index 8478eccb774f24..f498131d997b2a 100644 --- a/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp +++ b/src/plugins/intel_npu/src/backend/src/zero_wrappers.cpp @@ -19,8 +19,8 @@ EventPool::EventPool(ze_device_handle_t device_handle, nullptr, ZE_EVENT_POOL_FLAG_HOST_VISIBLE, event_count}; - zeroUtils::throwOnFail("zeEventPoolCreate", - zeEventPoolCreate(context, &event_pool_desc, 1, &device_handle, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeEventPoolCreate", + zeEventPoolCreate(context, &event_pool_desc, 1, &device_handle, &_handle)); } EventPool::~EventPool() { auto result = zeEventPoolDestroy(_handle); @@ -32,25 +32,25 @@ EventPool::~EventPool() { Event::Event(const ze_event_pool_handle_t& event_pool, uint32_t event_index, const Config& config) : _log("Event", config.get()) { ze_event_desc_t event_desc = {ZE_STRUCTURE_TYPE_EVENT_DESC, nullptr, event_index, 0, 0}; - zeroUtils::throwOnFail("zeEventCreate", zeEventCreate(event_pool, &event_desc, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeEventCreate", zeEventCreate(event_pool, &event_desc, &_handle)); } void Event::AppendSignalEvent(CommandList& command_list) const { - zeroUtils::throwOnFail("zeCommandListAppendSignalEvent", - zeCommandListAppendSignalEvent(command_list.handle(), _handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListAppendSignalEvent", + zeCommandListAppendSignalEvent(command_list.handle(), _handle)); } void Event::AppendWaitOnEvent(CommandList& command_list) { - zeroUtils::throwOnFail("zeCommandListAppendWaitOnEvents", - zeCommandListAppendWaitOnEvents(command_list.handle(), 1, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListAppendWaitOnEvents", + zeCommandListAppendWaitOnEvents(command_list.handle(), 1, &_handle)); } void Event::AppendEventReset(CommandList& command_list) const { - zeroUtils::throwOnFail("zeCommandListAppendEventReset", - zeCommandListAppendEventReset(command_list.handle(), _handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListAppendEventReset", + zeCommandListAppendEventReset(command_list.handle(), _handle)); } void Event::hostSynchronize() const { - zeroUtils::throwOnFail("zeEventHostSynchronize", zeEventHostSynchronize(_handle, UINT64_MAX)); + THROW_ON_FAIL_FOR_BACKEND("zeEventHostSynchronize", zeEventHostSynchronize(_handle, UINT64_MAX)); } void Event::reset() const { - zeroUtils::throwOnFail("zeEventHostReset", zeEventHostReset(_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeEventHostReset", zeEventHostReset(_handle)); } Event::~Event() { auto result = zeEventDestroy(_handle); @@ -70,42 +70,46 @@ CommandList::CommandList(const ze_device_handle_t& device_handle, _log("CommandList", config.get()) { ze_mutable_command_list_exp_desc_t mutable_desc = {ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_LIST_EXP_DESC, nullptr, 0}; ze_command_list_desc_t desc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC, &mutable_desc, group_ordinal, 0}; - zeroUtils::throwOnFail("zeCommandListCreate", zeCommandListCreate(_context, device_handle, &desc, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListCreate", zeCommandListCreate(_context, device_handle, &desc, &_handle)); if (mtci_is_supported) { ze_mutable_command_id_exp_desc_t mutableCmdIdDesc = {ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_ID_EXP_DESC, nullptr, ZE_MUTABLE_COMMAND_EXP_FLAG_GRAPH_ARGUMENT}; - zeroUtils::throwOnFail("zeCommandListGetNextCommandIdExp", - zeCommandListGetNextCommandIdExp(_handle, &mutableCmdIdDesc, &_command_id)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListGetNextCommandIdExp", + zeCommandListGetNextCommandIdExp(_handle, &mutableCmdIdDesc, &_command_id)); } } void CommandList::reset() const { - zeroUtils::throwOnFail("zeCommandListReset", zeCommandListReset(_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListReset", zeCommandListReset(_handle)); } void CommandList::appendMemoryCopy(void* dst, const void* src, const std::size_t size) const { - zeroUtils::throwOnFail("zeCommandListAppendMemoryCopy", - zeCommandListAppendMemoryCopy(_handle, dst, src, size, nullptr, 0, nullptr)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListAppendMemoryCopy", + zeCommandListAppendMemoryCopy(_handle, dst, src, size, nullptr, 0, nullptr)); } void CommandList::appendGraphInitialize(const ze_graph_handle_t& graph_handle) const { - zeroUtils::throwOnFail("pfnAppendGraphInitialize", - _graph_ddi_table_ext.pfnAppendGraphInitialize(_handle, graph_handle, nullptr, 0, nullptr)); + ze_result_t result = _graph_ddi_table_ext.pfnAppendGraphInitialize(_handle, graph_handle, nullptr, 0, nullptr); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnAppendGraphInitialize", result, _graph_ddi_table_ext); + } } void CommandList::appendGraphExecute(const ze_graph_handle_t& graph_handle, const ze_graph_profiling_query_handle_t& profiling_query_handle) const { - zeroUtils::throwOnFail( - "pfnAppendGraphExecute", - _graph_ddi_table_ext.pfnAppendGraphExecute(_handle, graph_handle, profiling_query_handle, nullptr, 0, nullptr)); + ze_result_t result = + _graph_ddi_table_ext.pfnAppendGraphExecute(_handle, graph_handle, profiling_query_handle, nullptr, 0, nullptr); + if (ZE_RESULT_SUCCESS != result) { + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnAppendGraphExecute", result, _graph_ddi_table_ext); + } } void CommandList::appendNpuTimestamp(uint64_t* timestamp_buff) const { - zeroUtils::throwOnFail("zeCommandListAppendWriteGlobalTimestamp", - zeCommandListAppendWriteGlobalTimestamp(_handle, timestamp_buff, nullptr, 0, nullptr)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListAppendWriteGlobalTimestamp", + zeCommandListAppendWriteGlobalTimestamp(_handle, timestamp_buff, nullptr, 0, nullptr)); } void CommandList::appendBarrier() const { - zeroUtils::throwOnFail("zeCommandListAppendBarrier", zeCommandListAppendBarrier(_handle, nullptr, 0, nullptr)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListAppendBarrier", zeCommandListAppendBarrier(_handle, nullptr, 0, nullptr)); } void CommandList::close() const { - zeroUtils::throwOnFail("zeCommandListClose", zeCommandListClose(_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListClose", zeCommandListClose(_handle)); } CommandList::~CommandList() { auto result = zeCommandListDestroy(_handle); @@ -124,8 +128,8 @@ void CommandList::updateMutableCommandList(uint32_t arg_index, const void* arg_v &desc, 0}; - zeroUtils::throwOnFail("zeCommandListUpdateMutableCommandsExp", - zeCommandListUpdateMutableCommandsExp(_handle, &mutable_commands_exp_desc_t)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandListUpdateMutableCommandsExp", + zeCommandListUpdateMutableCommandsExp(_handle, &mutable_commands_exp_desc_t)); } CommandQueue::CommandQueue(const ze_device_handle_t& device_handle, @@ -148,22 +152,22 @@ CommandQueue::CommandQueue(const ze_device_handle_t& device_handle, OPENVINO_THROW("Turbo is not supported by the current driver"); } } - zeroUtils::throwOnFail("zeCommandQueueCreate", - zeCommandQueueCreate(_context, device_handle, &queue_desc, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandQueueCreate", + zeCommandQueueCreate(_context, device_handle, &queue_desc, &_handle)); } void CommandQueue::executeCommandList(CommandList& command_list) const { - zeroUtils::throwOnFail("zeCommandQueueExecuteCommandLists", - zeCommandQueueExecuteCommandLists(_handle, 1, &command_list._handle, nullptr)); + THROW_ON_FAIL_FOR_BACKEND("zeCommandQueueExecuteCommandLists", + zeCommandQueueExecuteCommandLists(_handle, 1, &command_list._handle, nullptr)); } void CommandQueue::executeCommandList(CommandList& command_list, Fence& fence) const { - zeroUtils::throwOnFail("zeCommandQueueExecuteCommandLists", - zeCommandQueueExecuteCommandLists(_handle, 1, &command_list._handle, fence.handle())); + THROW_ON_FAIL_FOR_BACKEND("zeCommandQueueExecuteCommandLists", + zeCommandQueueExecuteCommandLists(_handle, 1, &command_list._handle, fence.handle())); } void CommandQueue::setWorkloadType(ze_command_queue_workload_type_t workloadType) const { if (_command_queue_npu_dditable_ext.version()) { - zeroUtils::throwOnFail("zeSetWorkloadType", - _command_queue_npu_dditable_ext.pfnSetWorkloadType(_handle, workloadType)); + THROW_ON_FAIL_FOR_BACKEND("zeSetWorkloadType", + _command_queue_npu_dditable_ext.pfnSetWorkloadType(_handle, workloadType)); } else { OPENVINO_THROW("The WorkloadType property is not supported by the current Driver Version!"); } @@ -178,13 +182,13 @@ CommandQueue::~CommandQueue() { Fence::Fence(const CommandQueue& command_queue, const Config& config) : _log("Fence", config.get()) { ze_fence_desc_t fence_desc = {ZE_STRUCTURE_TYPE_FENCE_DESC, nullptr, 0}; - zeroUtils::throwOnFail("zeFenceCreate", zeFenceCreate(command_queue.handle(), &fence_desc, &_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeFenceCreate", zeFenceCreate(command_queue.handle(), &fence_desc, &_handle)); } void Fence::reset() const { - zeroUtils::throwOnFail("zeFenceReset", zeFenceReset(_handle)); + THROW_ON_FAIL_FOR_BACKEND("zeFenceReset", zeFenceReset(_handle)); } void Fence::hostSynchronize() const { - zeroUtils::throwOnFail("zeFenceHostSynchronize", zeFenceHostSynchronize(_handle, UINT64_MAX)); + THROW_ON_FAIL_FOR_BACKEND("zeFenceHostSynchronize", zeFenceHostSynchronize(_handle, UINT64_MAX)); } Fence::~Fence() { auto result = zeFenceDestroy(_handle); diff --git a/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp b/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp index dfd2b247849165..4eec7884a9bfb7 100644 --- a/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp +++ b/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp @@ -376,29 +376,17 @@ void LevelZeroCompilerInDriver::getNativeBinary(ze_graph_dditabl // Get blob size first auto result = _graphDdiTableExt.pfnGetNativeBinary(graphHandle, &blobSize, nullptr); blob.resize(blobSize); - - OPENVINO_ASSERT(result == ZE_RESULT_SUCCESS, - "Failed to compile network. L0 pfnGetNativeBinary get blob size", - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result), - ". ", - getLatestBuildError()); + if (ZE_RESULT_SUCCESS != result) { + _logger.warning("Failed to compile network. "); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetNativeBinary get blob size", result, _graphDdiTableExt); + } // Get blob data result = _graphDdiTableExt.pfnGetNativeBinary(graphHandle, &blobSize, blob.data()); - - OPENVINO_ASSERT(result == ZE_RESULT_SUCCESS, - "Failed to compile network. L0 pfnGetNativeBinary get blob data", - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result), - ". ", - getLatestBuildError()); + if (ZE_RESULT_SUCCESS != result) { + _logger.warning("Failed to compile network. "); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetNativeBinary get blob data", result, _graphDdiTableExt); + } blobPtr = blob.data(); } @@ -412,16 +400,10 @@ void LevelZeroCompilerInDriver::getNativeBinary(ze_graph_dditabl size_t& blobSize) const { // Get blob ptr and size auto result = _graphDdiTableExt.pfnGetNativeBinary2(graphHandle, &blobSize, &blobPtr); - - OPENVINO_ASSERT(result == ZE_RESULT_SUCCESS, - "Failed to compile network. L0 pfnGetNativeBinary get blob size", - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result), - ". ", - getLatestBuildError()); + if (ZE_RESULT_SUCCESS != result) { + _logger.warning("Failed to compile network. "); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetNativeBinary get blob size", result, _graphDdiTableExt); + } } template @@ -668,7 +650,7 @@ ze_result_t LevelZeroCompilerInDriver::seriazlideIRModelAndQuery // Create querynetwork handle ze_result_t result = _graphDdiTableExt.pfnQueryNetworkCreate(_context, _deviceHandle, &desc, &hGraphQueryNetwork); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("seriazlideIRModelAndQueryNetworkCreateV1", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("seriazlideIRModelAndQueryNetworkCreateV1", result, _graphDdiTableExt); } return result; } @@ -684,7 +666,7 @@ std::unordered_set LevelZeroCompilerInDriver::query ze_device_graph_properties_t deviceGraphProperties{}; auto result = _graphDdiTableExt.pfnDeviceGetGraphProperties(_deviceHandle, &deviceGraphProperties); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnDeviceGetGraphProperties", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnDeviceGetGraphProperties", result, _graphDdiTableExt); } ze_graph_query_network_handle_t hGraphQueryNetwork = nullptr; @@ -726,7 +708,7 @@ ze_result_t LevelZeroCompilerInDriver::seriazlideIRModelAndQuery _logger.debug("seriazlideIRModelAndQueryNetworkCreateV2 - performing pfnQueryNetworkCreate2"); ze_result_t result = _graphDdiTableExt.pfnQueryNetworkCreate2(_context, _deviceHandle, &desc, &hGraphQueryNetwork); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("seriazlideIRModelAndQueryNetworkCreateV2", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("seriazlideIRModelAndQueryNetworkCreateV2", result, _graphDdiTableExt); } return result; } @@ -742,7 +724,7 @@ std::unordered_set LevelZeroCompilerInDriver::query ze_device_graph_properties_t deviceGraphProperties{}; auto result = _graphDdiTableExt.pfnDeviceGetGraphProperties(_deviceHandle, &deviceGraphProperties); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnDeviceGetGraphProperties", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnDeviceGetGraphProperties", result, _graphDdiTableExt); } ze_graph_query_network_handle_t hGraphQueryNetwork = nullptr; @@ -765,7 +747,9 @@ std::unordered_set LevelZeroCompilerInDriver::getQu result = _graphDdiTableExt.pfnQueryNetworkGetSupportedLayers(hGraphQueryNetwork, &size, nullptr); if (ZE_RESULT_SUCCESS != result) { _graphDdiTableExt.pfnQueryNetworkDestroy(hGraphQueryNetwork); - THROW_ON_FAIL("pfnQueryNetworkGetSupportedLayers get size of query result", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnQueryNetworkGetSupportedLayers get size of query result", + result, + _graphDdiTableExt); } // Get the result data of query @@ -773,12 +757,14 @@ std::unordered_set LevelZeroCompilerInDriver::getQu result = _graphDdiTableExt.pfnQueryNetworkGetSupportedLayers(hGraphQueryNetwork, &size, supportedLayers.data()); if (ZE_RESULT_SUCCESS != result) { _graphDdiTableExt.pfnQueryNetworkDestroy(hGraphQueryNetwork); - THROW_ON_FAIL("pfnQueryNetworkGetSupportedLayers get result data of query", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnQueryNetworkGetSupportedLayers get result data of query", + result, + _graphDdiTableExt); } result = _graphDdiTableExt.pfnQueryNetworkDestroy(hGraphQueryNetwork); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnQueryNetworkDestroy", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnQueryNetworkDestroy", result, _graphDdiTableExt); } return parseQueryResult(supportedLayers); } @@ -824,7 +810,7 @@ ze_result_t LevelZeroCompilerInDriver::createGraph(const ze_grap // Create querynetwork handle auto result = _graphDdiTableExt.pfnCreate(_context, _deviceHandle, &desc, graph); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnCreate", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnCreate", result, _graphDdiTableExt); } return result; } @@ -849,7 +835,7 @@ ze_result_t LevelZeroCompilerInDriver::createGraph(const ze_grap // Create querynetwork handle auto result = _graphDdiTableExt.pfnCreate2(_context, _deviceHandle, &desc, graph); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnCreate2", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnCreate2", result, _graphDdiTableExt); } return result; } @@ -894,7 +880,9 @@ NetworkDescription LevelZeroCompilerInDriver::compile(const std: ze_device_graph_properties_t deviceGraphProperties{}; auto result = _graphDdiTableExt.pfnDeviceGetGraphProperties(_deviceHandle, &deviceGraphProperties); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnDeviceGetGraphProperties, Failed to compile network.", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnDeviceGetGraphProperties, Failed to compile network.", + result, + _graphDdiTableExt); } // Graph handle should be used only in scope of compile / parse functions. ze_graph_handle_t graphHandle; @@ -929,7 +917,7 @@ NetworkMetadata LevelZeroCompilerInDriver::parse(const std::vect auto result = _graphDdiTableExt.pfnCreate(_context, _deviceHandle, &desc, &graphHandle); OV_ITT_TASK_NEXT(PARSE_BLOB, "_graphDdiTableExt"); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnCreate", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnCreate", result, _graphDdiTableExt); } } else { OPENVINO_THROW("Empty blob"); @@ -951,7 +939,7 @@ uint32_t LevelZeroCompilerInDriver::getSupportedOpsetVersion() c auto result = _graphDdiTableExt.pfnDeviceGetGraphProperties(_deviceHandle, &graphProperties); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnDeviceGetGraphProperties", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnDeviceGetGraphProperties", result, _graphDdiTableExt); } const auto maxOpsetVersion = graphProperties.maxOVOpsetVersionSupported; _logger.info("getSupportedOpsetVersion Max supported version of opset in CiD: %d", maxOpsetVersion); @@ -1024,7 +1012,7 @@ void LevelZeroCompilerInDriver::getMetadata(ze_graph_dditable_ex ze_graph_argument_properties_3_t arg; auto result = graphDdiTableExt.pfnGetArgumentProperties3(graphHandle, index, &arg); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnGetArgumentProperties3", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetArgumentProperties3", result, _graphDdiTableExt); } switch (arg.type) { case ZE_GRAPH_ARGUMENT_TYPE_INPUT: { @@ -1049,7 +1037,7 @@ void LevelZeroCompilerInDriver::getMetadata(ze_graph_dditable_ex ze_graph_argument_properties_3_t arg; auto result = graphDdiTableExt.pfnGetArgumentProperties3(graphHandle, index, &arg); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnGetArgumentProperties3", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetArgumentProperties3", result, _graphDdiTableExt); } std::optional optionalMetadata = std::nullopt; @@ -1057,7 +1045,7 @@ void LevelZeroCompilerInDriver::getMetadata(ze_graph_dditable_ex ze_graph_argument_metadata_t metadata; result = graphDdiTableExt.pfnGraphGetArgumentMetadata(graphHandle, index, &metadata); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnGraphGetArgumentMetadata", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGraphGetArgumentMetadata", result, _graphDdiTableExt); } optionalMetadata = std::optional(metadata); } @@ -1081,7 +1069,7 @@ NetworkMetadata LevelZeroCompilerInDriver::getNetworkMeta(ze_gra auto result = _graphDdiTableExt.pfnGetProperties(graphHandle, &graphProperties); if (ZE_RESULT_SUCCESS != result) { - THROW_ON_FAIL("pfnGetProperties", result, _graphDdiTableExt); + THROW_ON_FAIL_FOR_GRAPH_EXT("pfnGetProperties", result, _graphDdiTableExt); } NetworkMetadata meta;