1212#include " common/npu_test_env_cfg.hpp"
1313#include " common_test_utils/subgraph_builders/multi_single_conv.hpp"
1414#include " common_test_utils/test_constants.hpp"
15- #include " intel_npu/config/options.hpp"
1615#include " intel_npu/utils/utils.hpp"
1716#include " intel_npu/utils/zero/zero_mem.hpp"
1817#include " intel_npu/utils/zero/zero_utils.hpp"
1918#include " ir_serializer.hpp"
20- #include " openvino/runtime/intel_npu/properties.hpp"
2119#include " ze_graph_ext_wrappers.hpp"
2220#include " zero_init_mock.hpp"
2321
@@ -79,15 +77,6 @@ class ZeroGraphTest : public ::testing::TestWithParam<CompilationParamsAndExtens
7977
8078 model = ov::test::utils::make_multi_single_conv ();
8179
82- options->add <::intel_npu::BYPASS_UMD_CACHING>();
83- options->add <::intel_npu::CACHE_DIR>();
84-
85- if (!configuration.empty ()) {
86- for (auto & configItem : configuration) {
87- npu_config.update ({{configItem.first , configItem.second .as <std::string>()}});
88- }
89- }
90-
9180 std::shared_ptr<ZeroInitStructsMock> zeroInitMock = std::make_shared<ZeroInitStructsMock>(graphExtVersion);
9281 zeroInitStruct = std::reinterpret_pointer_cast<ZeroInitStructsHolder>(zeroInitMock);
9382 zeGraphExt = std::make_shared<ZeGraphExtWrappers>(zeroInitStruct);
@@ -108,13 +97,30 @@ class ZeroGraphTest : public ::testing::TestWithParam<CompilationParamsAndExtens
10897 serializedIR = irSerializer->serializeIR (model, compilerVersion, maxOpsetVersion);
10998 }
11099
100+ bool disablCache () {
101+ if (!configuration.empty ()) {
102+ for (auto & configItem : configuration) {
103+ if (configItem.first == " CACHE_DIR" ) {
104+ const auto set_cache_dir = configItem.second ;
105+ if (!set_cache_dir.empty ()) {
106+ return true ;
107+ }
108+ }
109+ if (configItem.first == " NPU_BYPASS_UMD_CACHING" ) {
110+ if (configItem.second .as <bool >()) {
111+ return true ;
112+ }
113+ }
114+ }
115+ }
116+
117+ return false ;
118+ }
119+
111120 std::shared_ptr<ZeroInitStructsHolder> zeroInitStruct;
112121 std::shared_ptr<ZeGraphExtWrappers> zeGraphExt;
113122 ov::AnyMap configuration;
114123
115- std::shared_ptr<::intel_npu::OptionsDesc> options = std::make_shared<::intel_npu::OptionsDesc>();
116- ::intel_npu::Config npu_config = ::intel_npu::Config(options);
117-
118124 SerializedIR serializedIR;
119125 GraphDescriptor graphDescriptor;
120126
@@ -130,7 +136,7 @@ using ZeroGraphCompilationTests = ZeroGraphTest;
130136
131137TEST_P (ZeroGraphCompilationTests, GetGraphInitIR) {
132138 serializeIR ();
133- OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
139+ OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
134140
135141 uint32_t initCommandQueueOrdinal = 0 ;
136142 OV_ASSERT_NO_THROW (initCommandQueueOrdinal =
@@ -141,7 +147,7 @@ TEST_P(ZeroGraphCompilationTests, GetGraphInitIR) {
141147
142148TEST_P (ZeroGraphCompilationTests, GetInitSetArgsDestroyGraphAlignedMemoryIR) {
143149 serializeIR ();
144- OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
150+ OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
145151
146152 uint32_t initCommandQueueOrdinal = 0 ;
147153 OV_ASSERT_NO_THROW (initCommandQueueOrdinal =
@@ -183,7 +189,7 @@ TEST_P(ZeroGraphTest, GetGraphInitBlob) {
183189
184190TEST_P (ZeroGraphTest, GetNetworkMeta) {
185191 serializeIR ();
186- OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
192+ OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
187193
188194 OV_ASSERT_NO_THROW (NetworkMetadata meta = zeGraphExt->getNetworkMeta (graphDescriptor));
189195}
@@ -223,7 +229,7 @@ TEST_P(ZeroGraphTest, GetGraphBinary) {
223229TEST_P (ZeroGraphTest, SetGraphArgOnNullBuffer) {
224230 serializeIR ();
225231
226- OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
232+ OV_ASSERT_NO_THROW (graphDescriptor = zeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
227233
228234 uint32_t initCommandQueueOrdinal = 0 ;
229235 OV_ASSERT_NO_THROW (initCommandQueueOrdinal =
@@ -310,7 +316,7 @@ TEST_P(ZeroGraphTest, SetUnalignedAddressBlob) {
310316 auto localZeGraphExt = std::make_shared<ZeGraphExtWrappers>(zeroInitStruct);
311317 GraphDescriptor localGraphDescriptor;
312318 serializeIR ();
313- OV_ASSERT_NO_THROW (localGraphDescriptor = localZeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
319+ OV_ASSERT_NO_THROW (localGraphDescriptor = localZeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
314320 const uint8_t * blobPtr = nullptr ;
315321 std::vector<uint8_t > blobVec; // plugin needs to keep a copy of the blob for older drivers
316322 size_t blobSize;
@@ -345,7 +351,7 @@ TEST_P(ZeroGraphTest, SetUnalignedSizeBlob) {
345351 auto localZeGraphExt = std::make_shared<ZeGraphExtWrappers>(zeroInitStruct);
346352 GraphDescriptor localGraphDescriptor;
347353 serializeIR ();
348- OV_ASSERT_NO_THROW (localGraphDescriptor = localZeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
354+ OV_ASSERT_NO_THROW (localGraphDescriptor = localZeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
349355 const uint8_t * blobPtr = nullptr ;
350356 std::vector<uint8_t > blobVec; // plugin needs to keep a copy of the blob for older drivers
351357 size_t blobSize;
@@ -380,7 +386,7 @@ TEST_P(ZeroGraphTest, SetAlignedBlob) {
380386 auto localZeGraphExt = std::make_shared<ZeGraphExtWrappers>(zeroInitStruct);
381387 GraphDescriptor localGraphDescriptor;
382388 serializeIR ();
383- OV_ASSERT_NO_THROW (localGraphDescriptor = localZeGraphExt->getGraphDescriptor (serializedIR, " " , npu_config ));
389+ OV_ASSERT_NO_THROW (localGraphDescriptor = localZeGraphExt->getGraphDescriptor (serializedIR, " " , disablCache () ));
384390 const uint8_t * blobPtr = nullptr ;
385391 std::vector<uint8_t > blobVec; // plugin needs to keep a copy of the blob for older drivers
386392 size_t blobSize;
0 commit comments