forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
/
executor_manager_tests.cpp
37 lines (26 loc) · 1.14 KB
/
executor_manager_tests.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2018-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <gtest/gtest.h>
#include "openvino/runtime/threading/executor_manager.hpp"
using namespace ::testing;
TEST(ExecutorManagerTests, canCreateSingleExecutorManager) {
auto executorManager1 = ov::threading::executor_manager();
auto executorManager2 = ov::threading::executor_manager();
ASSERT_EQ(executorManager1, executorManager2);
}
TEST(ExecutorManagerTests, createDifferentExecutorsForDifferentDevices) {
auto executorMgr = ov::threading::executor_manager();
auto executor1 = executorMgr->get_executor("CPU");
auto executor2 = executorMgr->get_executor("GPU");
ASSERT_NE(executor1, executor2);
ASSERT_EQ(2, executorMgr->get_executors_number());
}
TEST(ExecutorManagerTests, returnTheSameExecutorForTheSameDevice) {
auto executorMgr = ov::threading::executor_manager();
auto executor1 = executorMgr->get_executor("CPU");
auto executor2 = executorMgr->get_executor("GPU");
auto executor = executorMgr->get_executor("GPU");
ASSERT_EQ(executor, executor2);
ASSERT_EQ(2, executorMgr->get_executors_number());
}