Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Use the correct stype and set ze_params to null (#30994)

Bogdan Pereanuacd35c9fe0cc
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp
index aa0a69ceed2..17d6014b485 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp
@@ -278,7 +278,7 @@ std::unordered_set<std::string> ZeGraphExtWrappers::queryGraph(std::pair<size_t,
ze_graph_handle_t ZeGraphExtWrappers::getGraphHandle(std::pair<size_t, std::shared_ptr<uint8_t>> serializedIR,
const std::string& buildFlags,
const uint32_t& flags) const {
- ze_graph_handle_t graphHandle;
+ ze_graph_handle_t graphHandle = nullptr;
if (NotSupportGraph2(_graphExtVersion)) {
// For ext version <1.5, calling pfnCreate api in _zeroInitStruct->getGraphDdiTable()
ze_graph_desc_t desc = {ZE_STRUCTURE_TYPE_GRAPH_DESC_PROPERTIES,
@@ -317,7 +317,7 @@ ze_graph_handle_t ZeGraphExtWrappers::getGraphHandle(std::pair<size_t, std::shar
}
ze_graph_handle_t ZeGraphExtWrappers::getGraphHandle(const uint8_t& blobData, size_t blobSize) const {
- ze_graph_handle_t graphHandle;
+ ze_graph_handle_t graphHandle = nullptr;
if (blobSize == 0) {
OPENVINO_THROW("Empty blob");
@@ -457,7 +457,8 @@ void ZeGraphExtWrappers::getMetadata(ze_graph_handle_t graphHandle,
}
NetworkMetadata ZeGraphExtWrappers::getNetworkMeta(ze_graph_handle_t graphHandle) const {
- ze_graph_properties_t graphProperties{};
+ ze_graph_properties_t graphProperties = {};
+ graphProperties.stype = ZE_STRUCTURE_TYPE_GRAPH_PROPERTIES;
_logger.debug("getNetworkMeta - perform pfnGetProperties");
auto result = _zeroInitStruct->getGraphDdiTable().pfnGetProperties(graphHandle, &graphProperties);
diff --git a/src/plugins/intel_npu/src/utils/src/zero/zero_remote_tensor.cpp b/src/plugins/intel_npu/src/utils/src/zero/zero_remote_tensor.cpp
index 3641ac4f264..eb3d10a801e 100644
--- a/src/plugins/intel_npu/src/utils/src/zero/zero_remote_tensor.cpp
+++ b/src/plugins/intel_npu/src/utils/src/zero/zero_remote_tensor.cpp
@@ -194,7 +194,7 @@ void ZeroRemoteTensor::allocate(const size_t bytes) {
nullptr,
ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF,
static_cast<int>(reinterpret_cast<intptr_t>(_mem))};
- ze_host_mem_alloc_desc_t desc = {.pNext = &memory_import};
+ ze_host_mem_alloc_desc_t desc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC, &memory_import, 0};
THROW_ON_FAIL_FOR_LEVELZERO(
"zeMemAllocHost",
zeMemAllocHost(_init_structs->getContext(), &desc, bytes, STANDARD_PAGE_SIZE, &_data));