Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] [NPU] Using global command queue #28661

Closed
wants to merge 13 commits into from
Closed
Prev Previous commit
Next Next commit
Add new func test
Signed-off-by: Bogdan Pereanu <[email protected]>
  • Loading branch information
pereanub committed Jan 29, 2025
commit d9002d0948a1efc7b691208b62793f408ebfe900
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,36 @@ TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsSyncInfers) {
}
}

TEST_P(InferRequestRunTests, MultipleCompiledModelsTestsSyncInfers) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
// Load CNNNetwork to target plugins
const int no_of_iterations = 256;
std::array<ov::CompiledModel, no_of_iterations> compiled_models;

for (int i = 0; i < no_of_iterations; ++i) {
OV_ASSERT_NO_THROW(compiled_models[i] = core->compile_model(ov_model, target_device, configuration));
}

// Create InferRequests
std::array<ov::InferRequest, no_of_iterations> infer_reqs;
std::array<std::thread, no_of_iterations> infer_reqs_threads;
for (int i = 0; i < no_of_iterations; ++i) {
OV_ASSERT_NO_THROW(infer_reqs[i] = compiled_models[i].create_infer_request());
}

for (int i = 0; i < no_of_iterations; ++i) {
infer_reqs_threads[i] = std::thread([&infer_reqs, i]() -> void {
OV_ASSERT_NO_THROW(infer_reqs[i].infer());
infer_reqs[i] = {};
});
}

for (int i = 0; i < no_of_iterations; ++i) {
infer_reqs_threads[i].join();
}
}

TEST_P(InferRequestRunTests, MultipleExecutorStreamsTestsAsyncInfers) {
// Skip test according to plugin specific disabledTestPatterns() (if any)
SKIP_IF_CURRENT_TEST_IS_DISABLED()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ TEST_P(OVCompileAndInferRequest, CompiledModelWorkloadTypeUpdateAfterCompilation
OV_ASSERT_NO_THROW(req2.start_async());
OV_ASSERT_NO_THROW(req2.wait());
ASSERT_TRUE(isCalled);

req1 = {};
req2 = {};
req3 = {};

OV_ASSERT_NO_THROW(req1 = execNet.create_infer_request());
OV_ASSERT_NO_THROW(req2 = secondCompiledModel.create_infer_request());
OV_ASSERT_NO_THROW(req1.infer());
OV_ASSERT_NO_THROW(req3 = execNet.create_infer_request());
OV_ASSERT_NO_THROW(req2.infer());
OV_ASSERT_NO_THROW(req3.infer());
OV_ASSERT_NO_THROW(req3.infer());
}
}

Expand Down