Skip to content

Commit

Permalink
Add new func test
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Pereanu <[email protected]>
  • Loading branch information
pereanub committed Jan 28, 2025
1 parent b908dab commit 5eae256
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
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

0 comments on commit 5eae256

Please sign in to comment.