Infra for device suffix (#13339)
* [IE TESTS] Using Gflags instead of parsing command-line options * Apply infra for suffix * remove extra * Squashed commit of the following: commitc249f5d581
Author: iefode <irina.efode@intel.com> Date: Thu Oct 6 11:56:11 2022 +0400 Fix default values for command-line argument commitb2dbb4418c
Author: iefode <irina.efode@intel.com> Date: Wed Oct 5 18:09:22 2022 +0400 rename gflags config * Fix errors * Remove gflag using * Remove gflags * Update main.cpp * Update main.cpp
This commit is contained in:
parent
b0fadcebd6
commit
78d6f68de4
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
void set_device_suffix(const std::string& suffix) {
|
||||
if (!suffix.empty()) {
|
||||
throw std::runtime_error("The suffix can't be used for CPU device!");
|
||||
}
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
17
src/plugins/template/tests/functional/set_device_name.cpp
Normal file
17
src/plugins/template/tests/functional/set_device_name.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
void set_device_suffix(const std::string& suffix) {
|
||||
if (!suffix.empty()) {
|
||||
throw std::runtime_error("The suffix can't be used for TEMPLATE device!");
|
||||
}
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
void set_device_suffix(const std::string& suffix) {
|
||||
if (!suffix.empty()) {
|
||||
throw std::runtime_error("The suffix can't be used for GNA device!");
|
||||
}
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <functional_test_utils/ov_plugin_cache.hpp>
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
|
||||
void set_device_suffix(const std::string& suffix) {
|
||||
std::string new_gpu_name = CommonTestUtils::DEVICE_GPU;
|
||||
new_gpu_name += CommonTestUtils::DEVICE_SUFFIX_SEPARATOR;
|
||||
new_gpu_name += suffix;
|
||||
auto available_devices = utils::PluginCache::get().core()->get_available_devices();
|
||||
if (std::find(available_devices.begin(), available_devices.end(), new_gpu_name) == available_devices.end()) {
|
||||
throw std::runtime_error("The device " + new_gpu_name + " is not in the available devices! Please use other on!");
|
||||
}
|
||||
CommonTestUtils::DEVICE_GPU = new_gpu_name.c_str();
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
void set_device_suffix(const std::string& suffix) {
|
||||
if (!suffix.empty()) {
|
||||
throw std::runtime_error("The suffix can't be used for MYRIAD device!");
|
||||
}
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
|
||||
void set_device_suffix(const std::string& suffix);
|
||||
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -8,6 +8,8 @@
|
||||
#include "functional_test_utils/summary/op_summary.hpp"
|
||||
#include "functional_test_utils/skip_tests_config.hpp"
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
FuncTestUtils::SkipTestsConfig::disable_tests_skipping = false;
|
||||
bool print_custom_help = false;
|
||||
@ -32,6 +34,10 @@ int main(int argc, char *argv[]) {
|
||||
throw std::runtime_error("Incorrect value of \"--save_report_timeout\" argument");
|
||||
}
|
||||
ov::test::utils::OpSummary::setSaveReportTimeout(timeout);
|
||||
} else if (std::string(argv[i]).find("--device_suffix") != std::string::npos) {
|
||||
std::string deviceSuffix = std::string(argv[i]).substr(std::string("--device_suffix").length() + 1);
|
||||
// TODO: uncomment after plugin impl merge
|
||||
// ov::test::set_device_suffix(deviceSuffix);
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,6 +59,8 @@ int main(int argc, char *argv[]) {
|
||||
std::cout << " Allow to try to save report in cycle using timeout (in seconds). " << std::endl;
|
||||
std::cout << " --extract_body" << std::endl;
|
||||
std::cout << " Allow to count extracted operation bodies to report. " << std::endl;
|
||||
std::cout << " --device_suffix" << std::endl;
|
||||
std::cout << " Optional. Device suffix" << std::endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "test_common.hpp"
|
||||
#include "common_utils.hpp"
|
||||
#include "test_constants.hpp"
|
||||
|
||||
#include <threading/ie_executor_manager.hpp>
|
||||
|
||||
|
21
src/tests/ie_test_utils/common_test_utils/test_constants.cpp
Normal file
21
src/tests/ie_test_utils/common_test_utils/test_constants.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
namespace CommonTestUtils {
|
||||
|
||||
const char *DEVICE_AUTO = "AUTO";
|
||||
const char *DEVICE_CPU = "CPU";
|
||||
const char *DEVICE_GNA = "GNA";
|
||||
const char *DEVICE_GPU = "GPU";
|
||||
const char *DEVICE_BATCH = "BATCH";
|
||||
const char *DEVICE_HDDL = "HDDL";
|
||||
const char *DEVICE_MYRIAD = "MYRIAD";
|
||||
const char *DEVICE_KEEMBAY = "VPUX";
|
||||
const char *DEVICE_MULTI = "MULTI";
|
||||
const char *DEVICE_TEMPLATE = "TEMPLATE";
|
||||
const char *DEVICE_HETERO = "HETERO";
|
||||
|
||||
} // namespace CommonTestUtils
|
@ -6,22 +6,24 @@
|
||||
|
||||
namespace CommonTestUtils {
|
||||
|
||||
const char DEVICE_AUTO[] = "AUTO";
|
||||
const char DEVICE_CPU[] = "CPU";
|
||||
const char DEVICE_GNA[] = "GNA";
|
||||
const char DEVICE_GPU[] = "GPU";
|
||||
const char DEVICE_BATCH[] = "BATCH";
|
||||
const char DEVICE_HDDL[] = "HDDL";
|
||||
const char DEVICE_MYRIAD[] = "MYRIAD";
|
||||
const char DEVICE_KEEMBAY[] = "VPUX";
|
||||
const char DEVICE_MULTI[] = "MULTI";
|
||||
const char DEVICE_TEMPLATE[] = "TEMPLATE";
|
||||
const char DEVICE_HETERO[] = "HETERO";
|
||||
extern const char* DEVICE_AUTO;
|
||||
extern const char* DEVICE_CPU;
|
||||
extern const char* DEVICE_GNA;
|
||||
extern const char* DEVICE_GPU;
|
||||
extern const char* DEVICE_BATCH;
|
||||
extern const char* DEVICE_HDDL;
|
||||
extern const char* DEVICE_MYRIAD;
|
||||
extern const char* DEVICE_KEEMBAY;
|
||||
extern const char* DEVICE_MULTI;
|
||||
extern const char* DEVICE_TEMPLATE;
|
||||
extern const char* DEVICE_HETERO;
|
||||
|
||||
const char OP_REPORT_FILENAME[] = "report_op";
|
||||
const char API_REPORT_FILENAME[] = "report_api";
|
||||
const char REPORT_EXTENSION[] = ".xml";
|
||||
|
||||
const char DEVICE_SUFFIX_SEPARATOR = '.';
|
||||
|
||||
const unsigned int maxFileNameLength = 140;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user