Remove deprecated option and enable compilation without device (#6022)
This commit is contained in:
@@ -66,10 +66,8 @@ In addition to common parameters, the MYRIAD plugin accepts the following option
|
||||
|
||||
| Parameter Name | Parameter Values | Default | Description |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `KEY_VPU_MYRIAD_PLATFORM` | empty string/`VPU_MYRIAD_2450`/`VPU_MYRIAD_2480` | empty string | If set, the plugin will use a device with specific platform to allocate a network. |
|
||||
| `KEY_VPU_MYRIAD_PROTOCOL` | empty string/`VPU_MYRIAD_USB`/`VPU_MYRIAD_PCIE` | empty string | If set, the plugin will use a device with specific protocol to allocate a network. |
|
||||
| `KEY_VPU_MYRIAD_FORCE_RESET` | `YES`/`NO` | `NO` | Enables force reset of all booted devices when new ExecutableNetwork is created.<br />This is a plugin scope option and must be used with the plugin's SetConfig method only.<br />See <a href="#MYRIAD_DEVICE_ALLOC">Device allocation</a> section for details. |
|
||||
| `KEY_VPU_PLATFORM` | empty string/`VPU_2450`/`VPU_2480` | empty string | **Deprecated** Use `KEY_VPU_MYRIAD_PLATFORM` instead. <br />If set, the plugin will use a device with specific platform to allocate a network. |
|
||||
| `KEY_VPU_FORCE_RESET` | `YES`/`NO` | `NO` | **Deprecated** Use `KEY_VPU_MYRIAD_FORCE_RESET` instead. <br />Enables force reset of all booted devices when new ExecutableNetwork is created.<br />This is a plugin scope option and must be used with the plugin's SetConfig method only.<br />See <a href="#MYRIAD_DEVICE_ALLOC">Device allocation</a> section for details. |
|
||||
|
||||
## Device allocation <a name="MYRIAD_DEVICE_ALLOC"> </a>
|
||||
|
||||
@@ -41,23 +41,6 @@ namespace VPUConfigParams {
|
||||
INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::MYRIAD_ENABLE_FORCE_RESET instead")
|
||||
DECLARE_VPU_MYRIAD_CONFIG_KEY(FORCE_RESET);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @brief This option allows to specify device.
|
||||
* If specified device is not available then creating infer request will throw an exception.
|
||||
*/
|
||||
INFERENCE_ENGINE_DEPRECATED("")
|
||||
DECLARE_VPU_MYRIAD_CONFIG_KEY(PLATFORM);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @brief Supported keys definition for VPU_MYRIAD_CONFIG_KEY(PLATFORM) option.
|
||||
*/
|
||||
INFERENCE_ENGINE_DEPRECATED("")
|
||||
DECLARE_VPU_MYRIAD_CONFIG_VALUE(2450);
|
||||
INFERENCE_ENGINE_DEPRECATED("")
|
||||
DECLARE_VPU_MYRIAD_CONFIG_VALUE(2480);
|
||||
|
||||
/**
|
||||
* @deprecated Use InferenceEngine::MYRIAD_DDR_TYPE instead
|
||||
* @brief This option allows to specify device memory type.
|
||||
|
||||
@@ -13,21 +13,20 @@
|
||||
namespace vpu {
|
||||
|
||||
struct DeviceResources {
|
||||
static int numShaves(const ncDevicePlatform_t& platform);
|
||||
static int numSlices(const ncDevicePlatform_t& platform);
|
||||
static int numShaves();
|
||||
static int numSlices();
|
||||
static int numStreams();
|
||||
};
|
||||
|
||||
struct DefaultAllocation {
|
||||
static int numStreams(const ncDevicePlatform_t& platform, const PluginConfiguration& configuration);
|
||||
static int numSlices(const ncDevicePlatform_t& platform, int numStreams);
|
||||
static int numShaves(const ncDevicePlatform_t& platform, int numStreams, int numSlices);
|
||||
static int numStreams(const PluginConfiguration& configuration);
|
||||
static int numSlices(int numStreams);
|
||||
static int numShaves(int numStreams, int numSlices);
|
||||
static int tilingCMXLimit(int numSlices);
|
||||
};
|
||||
|
||||
struct CompileEnv final {
|
||||
public:
|
||||
ncDevicePlatform_t platform;
|
||||
Resources resources;
|
||||
|
||||
PluginConfiguration config;
|
||||
@@ -50,14 +49,13 @@ public:
|
||||
static const CompileEnv* getOrNull();
|
||||
|
||||
static void init(
|
||||
ncDevicePlatform_t platform,
|
||||
const PluginConfiguration& config,
|
||||
const Logger::Ptr& log);
|
||||
static void updateConfig(const PluginConfiguration& config);
|
||||
static void free();
|
||||
|
||||
private:
|
||||
explicit CompileEnv(ncDevicePlatform_t platform);
|
||||
CompileEnv();
|
||||
};
|
||||
|
||||
} // namespace vpu
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright (C) 2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "vpu/configuration/as_parameter_enabler.hpp"
|
||||
|
||||
#include <mvnc.h>
|
||||
|
||||
namespace vpu {
|
||||
|
||||
namespace details {
|
||||
|
||||
enum class Access;
|
||||
enum class Category;
|
||||
|
||||
} // namespace details
|
||||
|
||||
class PluginConfiguration;
|
||||
|
||||
struct PlatformOption : public AsParameterEnabler {
|
||||
using value_type = ncDevicePlatform_t;
|
||||
|
||||
static std::string key();
|
||||
static void validate(const std::string&);
|
||||
static void validate(const PluginConfiguration&);
|
||||
static std::string defaultValue();
|
||||
static value_type parse(const std::string&);
|
||||
static details::Access access();
|
||||
static details::Category category();
|
||||
};
|
||||
|
||||
} // namespace vpu
|
||||
@@ -71,7 +71,7 @@ struct CompiledGraph final {
|
||||
// compileNetwork
|
||||
//
|
||||
|
||||
CompiledGraph::Ptr compileNetwork(const ie::CNNNetwork& network, ncDevicePlatform_t platform, const PluginConfiguration& config, const Logger::Ptr& log,
|
||||
CompiledGraph::Ptr compileNetwork(const ie::CNNNetwork& network, const PluginConfiguration& config, const Logger::Ptr& log,
|
||||
const std::shared_ptr<ie::ICore> core);
|
||||
|
||||
CompiledGraph::Ptr compileSubNetwork(const ie::CNNNetwork& network, const PluginConfiguration& subConfig, const std::shared_ptr<ie::ICore> core);
|
||||
@@ -80,7 +80,7 @@ CompiledGraph::Ptr compileSubNetwork(const ie::CNNNetwork& network, const Plugin
|
||||
// getSupportedLayers
|
||||
//
|
||||
|
||||
std::set<std::string> getSupportedLayers(const ie::CNNNetwork& network, ncDevicePlatform_t platform, const PluginConfiguration& config, const Logger::Ptr& log,
|
||||
std::set<std::string> getSupportedLayers(const ie::CNNNetwork& network, const PluginConfiguration& config, const Logger::Ptr& log,
|
||||
const std::shared_ptr<ie::ICore> core);
|
||||
|
||||
//
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace vpu {
|
||||
|
||||
CompiledGraph::Ptr compileModel(
|
||||
const Model& model,
|
||||
ncDevicePlatform_t platform,
|
||||
const PluginConfiguration& config,
|
||||
const Logger::Ptr& log);
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
// Copyright (C) 2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "vpu/configuration/options/platform.hpp"
|
||||
#include "vpu/utils/containers.hpp"
|
||||
#include "vpu/configuration/plugin_configuration.hpp"
|
||||
|
||||
#include <vpu/myriad_config.hpp>
|
||||
#include <vpu/myriad_plugin_config.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace vpu {
|
||||
|
||||
namespace {
|
||||
|
||||
const std::unordered_map<std::string, ncDevicePlatform_t>& string2platform() {
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
static const std::unordered_map<std::string, ncDevicePlatform_t> converters = {
|
||||
{VPU_MYRIAD_CONFIG_VALUE(2450), ncDevicePlatform_t::NC_MYRIAD_2},
|
||||
{VPU_MYRIAD_CONFIG_VALUE(2480), ncDevicePlatform_t::NC_MYRIAD_X},
|
||||
{std::string(), ncDevicePlatform_t::NC_ANY_PLATFORM},
|
||||
};
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
return converters;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void PlatformOption::validate(const std::string& value) {
|
||||
const auto& converters = string2platform();
|
||||
VPU_THROW_UNLESS(converters.count(value) != 0, R"(unexpected {} option value "{}", only {} are supported)",
|
||||
key(), value, getKeys(converters));
|
||||
}
|
||||
|
||||
void PlatformOption::validate(const PluginConfiguration& configuration) {
|
||||
validate(configuration[key()]);
|
||||
}
|
||||
|
||||
std::string PlatformOption::key() {
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
return VPU_MYRIAD_CONFIG_KEY(PLATFORM);
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
details::Access PlatformOption::access() {
|
||||
return details::Access::Public;
|
||||
}
|
||||
|
||||
details::Category PlatformOption::category() {
|
||||
return details::Category::RunTime;
|
||||
}
|
||||
|
||||
std::string PlatformOption::defaultValue() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
PlatformOption::value_type PlatformOption::parse(const std::string& value) {
|
||||
const auto& converters = string2platform();
|
||||
VPU_THROW_UNSUPPORTED_OPTION_UNLESS(converters.count(value) != 0, R"(unexpected {} option value "{}", only {} are supported)",
|
||||
key(), value, getKeys(converters));
|
||||
return converters.at(value);
|
||||
}
|
||||
|
||||
} // namespace vpu
|
||||
@@ -479,10 +479,6 @@ ModelPtr FrontEnd::runCommonPasses(ie::CNNNetwork network,
|
||||
env.log->trace("Parse custom layers : %s", customLayers);
|
||||
VPU_LOGGER_SECTION(env.log);
|
||||
|
||||
if (env.platform != ncDevicePlatform_t::NC_MYRIAD_X) {
|
||||
VPU_THROW_FORMAT("Custom layers are not supported for %v platforms", env.platform);
|
||||
}
|
||||
|
||||
_customLayers = CustomLayer::loadFromFile(customLayers);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ thread_local CompileEnv* g_compileEnv = nullptr;
|
||||
|
||||
} // namespace
|
||||
|
||||
CompileEnv::CompileEnv(ncDevicePlatform_t platform) : platform(platform) {}
|
||||
CompileEnv::CompileEnv() {}
|
||||
|
||||
const CompileEnv& CompileEnv::get() {
|
||||
IE_ASSERT(g_compileEnv != nullptr);
|
||||
@@ -79,8 +79,8 @@ const CompileEnv* CompileEnv::getOrNull() {
|
||||
return g_compileEnv;
|
||||
}
|
||||
|
||||
void CompileEnv::init(ncDevicePlatform_t platform, const PluginConfiguration& config, const Logger::Ptr& log) {
|
||||
g_compileEnv = new CompileEnv(platform);
|
||||
void CompileEnv::init(const PluginConfiguration& config, const Logger::Ptr& log) {
|
||||
g_compileEnv = new CompileEnv();
|
||||
g_compileEnv->config = config;
|
||||
g_compileEnv->log = log;
|
||||
|
||||
@@ -88,22 +88,18 @@ void CompileEnv::init(ncDevicePlatform_t platform, const PluginConfiguration& co
|
||||
g_compileEnv->profile.setLogger(log);
|
||||
#endif
|
||||
|
||||
if (platform == ncDevicePlatform_t::NC_MYRIAD_2) {
|
||||
g_compileEnv->config.set(ie::MYRIAD_ENABLE_HW_ACCELERATION, ie::PluginConfigParams::NO);
|
||||
}
|
||||
|
||||
const auto numExecutors = config.get<ThroughputStreamsOption>().hasValue()
|
||||
? config.get<ThroughputStreamsOption>().get() : DefaultAllocation::numStreams(platform, config);
|
||||
? config.get<ThroughputStreamsOption>().get() : DefaultAllocation::numStreams(config);
|
||||
VPU_THROW_UNLESS(numExecutors >= 1 && numExecutors <= DeviceResources::numStreams(),
|
||||
R"(Value of configuration option ("{}") must be in the range [{}, {}], actual is "{}")",
|
||||
ThroughputStreamsOption::key(), 1, DeviceResources::numStreams(), numExecutors);
|
||||
|
||||
const auto numSlices = config.get<NumberOfCMXSlicesOption>().hasValue()
|
||||
? config.get<NumberOfCMXSlicesOption>().get()
|
||||
: DefaultAllocation::numSlices(platform, numExecutors);
|
||||
VPU_THROW_UNLESS(numSlices >= 1 && numSlices <= DeviceResources::numSlices(platform),
|
||||
: DefaultAllocation::numSlices(numExecutors);
|
||||
VPU_THROW_UNLESS(numSlices >= 1 && numSlices <= DeviceResources::numSlices(),
|
||||
R"(Value of configuration option ("{}") must be in the range [{}, {}], actual is "{}")",
|
||||
NumberOfCMXSlicesOption::key(), 1, DeviceResources::numSlices(platform), numSlices);
|
||||
NumberOfCMXSlicesOption::key(), 1, DeviceResources::numSlices(), numSlices);
|
||||
|
||||
int defaultCmxLimit = DefaultAllocation::tilingCMXLimit(numSlices);
|
||||
const auto tilingCMXLimit = config.get<TilingCMXLimitKBOption>().hasValue()
|
||||
@@ -115,18 +111,18 @@ void CompileEnv::init(ncDevicePlatform_t platform, const PluginConfiguration& co
|
||||
|
||||
const auto numShaves = config.get<NumberOfSHAVEsOption>().hasValue()
|
||||
? config.get<NumberOfSHAVEsOption>().get()
|
||||
: DefaultAllocation::numShaves(platform, numExecutors, numSlices);
|
||||
VPU_THROW_UNLESS(numShaves >= 1 && numShaves <= DeviceResources::numShaves(platform),
|
||||
: DefaultAllocation::numShaves(numExecutors, numSlices);
|
||||
VPU_THROW_UNLESS(numShaves >= 1 && numShaves <= DeviceResources::numShaves(),
|
||||
R"(Value of configuration option ("{}") must be in the range [{}, {}], actual is "{}")",
|
||||
NumberOfSHAVEsOption::key(), 1, DeviceResources::numShaves(platform), numShaves);
|
||||
NumberOfSHAVEsOption::key(), 1, DeviceResources::numShaves(), numShaves);
|
||||
|
||||
const auto numAllocatedShaves = numShaves * numExecutors;
|
||||
VPU_THROW_UNLESS(numAllocatedShaves >= 1 && numAllocatedShaves <= DeviceResources::numShaves(platform),
|
||||
R"(Cannot allocate "{}" shaves: only {} is available)", numAllocatedShaves, DeviceResources::numShaves(platform));
|
||||
VPU_THROW_UNLESS(numAllocatedShaves >= 1 && numAllocatedShaves <= DeviceResources::numShaves(),
|
||||
R"(Cannot allocate "{}" shaves: only {} is available)", numAllocatedShaves, DeviceResources::numShaves());
|
||||
|
||||
const auto numAllocatedSlices = numSlices * numExecutors;
|
||||
VPU_THROW_UNLESS(numAllocatedSlices >= 1 && numAllocatedSlices <= DeviceResources::numSlices(platform),
|
||||
R"(Cannot allocate "{}" slices: only {} is available)", numAllocatedSlices, DeviceResources::numSlices(platform));
|
||||
VPU_THROW_UNLESS(numAllocatedSlices >= 1 && numAllocatedSlices <= DeviceResources::numSlices(),
|
||||
R"(Cannot allocate "{}" slices: only {} is available)", numAllocatedSlices, DeviceResources::numSlices());
|
||||
|
||||
g_compileEnv->resources.numSHAVEs = numShaves;
|
||||
g_compileEnv->resources.numCMXSlices = numSlices;
|
||||
@@ -203,9 +199,9 @@ CompiledGraph::Ptr compileImpl(const Model& model) {
|
||||
|
||||
} // namespace
|
||||
|
||||
CompiledGraph::Ptr compileNetwork(const ie::CNNNetwork& network, ncDevicePlatform_t platform, const PluginConfiguration& config, const Logger::Ptr& log,
|
||||
CompiledGraph::Ptr compileNetwork(const ie::CNNNetwork& network, const PluginConfiguration& config, const Logger::Ptr& log,
|
||||
const std::shared_ptr<ie::ICore> core) {
|
||||
CompileEnv::init(platform, config, log);
|
||||
CompileEnv::init(config, log);
|
||||
AutoScope autoDeinit([] {
|
||||
CompileEnv::free();
|
||||
});
|
||||
@@ -217,10 +213,9 @@ CompiledGraph::Ptr compileNetwork(const ie::CNNNetwork& network, ncDevicePlatfor
|
||||
|
||||
CompiledGraph::Ptr compileModel(
|
||||
const Model& model,
|
||||
ncDevicePlatform_t platform,
|
||||
const PluginConfiguration& config,
|
||||
const Logger::Ptr& log) {
|
||||
CompileEnv::init(platform, config, log);
|
||||
CompileEnv::init(config, log);
|
||||
AutoScope autoDeinit([] {
|
||||
CompileEnv::free();
|
||||
});
|
||||
@@ -251,11 +246,10 @@ CompiledGraph::Ptr compileSubNetwork(const ie::CNNNetwork& network, const Plugin
|
||||
|
||||
std::set<std::string> getSupportedLayers(
|
||||
const ie::CNNNetwork& network,
|
||||
ncDevicePlatform_t platform,
|
||||
const PluginConfiguration& config,
|
||||
const Logger::Ptr& log,
|
||||
const std::shared_ptr<ie::ICore> core) {
|
||||
CompileEnv::init(platform, config, log);
|
||||
CompileEnv::init(config, log);
|
||||
AutoScope autoDeinit([] {
|
||||
CompileEnv::free();
|
||||
});
|
||||
@@ -267,29 +261,29 @@ std::set<std::string> getSupportedLayers(
|
||||
return frontEnd->checkSupportedLayers(network);
|
||||
}
|
||||
|
||||
int DeviceResources::numShaves(const ncDevicePlatform_t& platform) {
|
||||
return platform == ncDevicePlatform_t::NC_MYRIAD_2 ? 12 : 16;
|
||||
int DeviceResources::numShaves() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
int DeviceResources::numSlices(const ncDevicePlatform_t& platform) {
|
||||
return platform == ncDevicePlatform_t::NC_MYRIAD_2 ? 12 : 19;
|
||||
int DeviceResources::numSlices() {
|
||||
return 19;
|
||||
}
|
||||
|
||||
int DeviceResources::numStreams() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
int DefaultAllocation::numStreams(const ncDevicePlatform_t& platform, const PluginConfiguration& configuration) {
|
||||
return platform == ncDevicePlatform_t::NC_MYRIAD_X && configuration.get<HwAccelerationOption>() ? 2 : 1;
|
||||
int DefaultAllocation::numStreams(const PluginConfiguration& configuration) {
|
||||
return configuration.get<HwAccelerationOption>() ? 2 : 1;
|
||||
}
|
||||
|
||||
int DefaultAllocation::numSlices(const ncDevicePlatform_t& platform, int numStreams) {
|
||||
const auto capabilities = DeviceResources::numSlices(platform);
|
||||
int DefaultAllocation::numSlices(int numStreams) {
|
||||
const auto capabilities = DeviceResources::numSlices();
|
||||
return capabilities / numStreams;
|
||||
}
|
||||
|
||||
int DefaultAllocation::numShaves(const ncDevicePlatform_t& platform, int numStreams, int numSlices) {
|
||||
const auto numAvailableShaves = DeviceResources::numShaves(platform);
|
||||
int DefaultAllocation::numShaves(int numStreams, int numSlices) {
|
||||
const auto numAvailableShaves = DeviceResources::numShaves();
|
||||
if (numStreams == 1) {
|
||||
return numAvailableShaves;
|
||||
}
|
||||
|
||||
@@ -197,12 +197,6 @@ StageSHAVEsRequirements StageNode::getSHAVEsRequirements() const {
|
||||
// Get result from Stage implementation.
|
||||
//
|
||||
|
||||
// return max for Myriad2
|
||||
const auto& compileEnv = CompileEnv::get();
|
||||
if (compileEnv.platform == ncDevicePlatform_t::NC_MYRIAD_2) {
|
||||
return StageSHAVEsRequirements::NeedMax;
|
||||
}
|
||||
|
||||
auto reqs = getSHAVEsRequirementsImpl();
|
||||
|
||||
//
|
||||
|
||||
@@ -54,9 +54,8 @@ ExecutableNetwork::ExecutableNetwork(
|
||||
|
||||
void ExecutableNetwork::openDevice(std::vector<DevicePtr>& devicePool) {
|
||||
_device = _executor->openDevice(devicePool, _config);
|
||||
const auto& revision = _device->revision();
|
||||
_actualNumExecutors = _config.get<ThroughputStreamsOption>().hasValue()
|
||||
? _config.get<ThroughputStreamsOption>().get() : DefaultAllocation::numStreams(revision, _config);
|
||||
? _config.get<ThroughputStreamsOption>().get() : DefaultAllocation::numStreams(_config);
|
||||
}
|
||||
|
||||
ExecutableNetwork::ExecutableNetwork(
|
||||
@@ -75,7 +74,6 @@ ExecutableNetwork::ExecutableNetwork(
|
||||
|
||||
auto compiledGraph = compileNetwork(
|
||||
network,
|
||||
NC_MYRIAD_X,
|
||||
_config,
|
||||
compilerLog,
|
||||
_core);
|
||||
|
||||
@@ -54,8 +54,7 @@ public:
|
||||
ie::IInferRequestInternal::Ptr CreateInferRequestImpl(ie::InputsDataMap networkInputs,
|
||||
ie::OutputsDataMap networkOutputs) override {
|
||||
if (!_isNetworkConstant && (_device == nullptr || !_device->isBooted())) {
|
||||
IE_THROW() << "Can not create infer request: there is no available devices with platform "
|
||||
<< _device->_platform;
|
||||
IE_THROW() << "Can not create infer request: there is no available devices with platform ";
|
||||
}
|
||||
|
||||
return std::make_shared<MyriadInferRequest>(_graphDesc, networkInputs, networkOutputs,
|
||||
@@ -66,8 +65,7 @@ public:
|
||||
|
||||
ie::IInferRequestInternal::Ptr CreateInferRequest() override {
|
||||
if (!_isNetworkConstant && (_device == nullptr || !_device->isBooted())) {
|
||||
IE_THROW() << "Can not create infer request: there is no available devices with platform "
|
||||
<< _device->_platform;
|
||||
IE_THROW() << "Can not create infer request: there is no available devices with platform ";
|
||||
}
|
||||
|
||||
auto syncRequestImpl = std::make_shared<MyriadInferRequest>(_graphDesc, _networkInputs, _networkOutputs,
|
||||
|
||||
@@ -90,7 +90,6 @@ ncStatus_t MyriadExecutor::bootNextDevice(std::vector<DevicePtr> &devicePool, co
|
||||
}
|
||||
#endif
|
||||
|
||||
const ncDevicePlatform_t& configPlatform = ncDevicePlatform_t::NC_ANY_PLATFORM;
|
||||
const ncDeviceProtocol_t& configProtocol = config.get<ProtocolOption>();
|
||||
const std::string& configDevName = config.get<DeviceIDOption>();
|
||||
PowerConfig powerConfig = config.get<PowerConfigOption>();
|
||||
@@ -114,7 +113,6 @@ ncStatus_t MyriadExecutor::bootNextDevice(std::vector<DevicePtr> &devicePool, co
|
||||
#endif
|
||||
|
||||
ncDeviceDescr_t in_deviceDesc = {};
|
||||
in_deviceDesc.platform = configPlatform;
|
||||
in_deviceDesc.protocol = configProtocol;
|
||||
|
||||
if (!configDevName.empty()) {
|
||||
@@ -126,13 +124,6 @@ ncStatus_t MyriadExecutor::bootNextDevice(std::vector<DevicePtr> &devicePool, co
|
||||
|
||||
if (it == availableDevicesDesc.end()) {
|
||||
IE_THROW() << "Myriad device: " << configDevName << " not found.";
|
||||
} else {
|
||||
ncDeviceDescr_t deviceDesc = *it;
|
||||
if (configPlatform != NC_ANY_PLATFORM &&
|
||||
configPlatform != deviceDesc.platform) {
|
||||
IE_THROW() << "Input value of device name and platform are contradict each other. Device name: " << configDevName
|
||||
<< "Platform: " << configPlatform;
|
||||
}
|
||||
}
|
||||
|
||||
configDevName.copy(in_deviceDesc.name, NC_MAX_NAME_SIZE - 1);
|
||||
@@ -164,8 +155,8 @@ ncStatus_t MyriadExecutor::bootNextDevice(std::vector<DevicePtr> &devicePool, co
|
||||
|
||||
// Get device protocol
|
||||
status = ncDeviceGetOption(device._deviceHandle, NC_RO_DEVICE_PLATFORM,
|
||||
reinterpret_cast<void*>(&device._platform), &dataLength);
|
||||
if (status != NC_OK || dataLength != sizeof(device._platform)) {
|
||||
reinterpret_cast<void*>(&device), &dataLength);
|
||||
if (status != NC_OK) {
|
||||
_log->warning("Failed to get device platform");
|
||||
ncDeviceClose(&device._deviceHandle, _mvnc->watchdogHndl());
|
||||
return status != NC_OK ? status : NC_ERROR; // for dataLength error
|
||||
@@ -273,10 +264,11 @@ DevicePtr MyriadExecutor::openDevice(std::vector<DevicePtr>& devicePool,
|
||||
return device->isBooted() && device->isNotFull()
|
||||
&& device->isSuitableForConfig(config);
|
||||
});
|
||||
|
||||
// Return mock device. If try infer with it, exception will be thrown
|
||||
if (availableDevices.empty()) {
|
||||
IE_THROW() << "Can not init Myriad device: " << ncStatusToStr(nullptr, booted);
|
||||
DeviceDesc device;
|
||||
device._protocol = config.get<ProtocolOption>();
|
||||
return std::make_shared<DeviceDesc>(device);
|
||||
}
|
||||
|
||||
auto deviceWithMinExecutors = std::min_element(availableDevices.begin(), availableDevices.end(),
|
||||
@@ -288,7 +280,6 @@ DevicePtr MyriadExecutor::openDevice(std::vector<DevicePtr>& devicePool,
|
||||
}
|
||||
|
||||
_log->info("Device #%d %s (%s protocol) allocated", devicePool.size() - 1,
|
||||
devicePool.back()->_platform == NC_MYRIAD_X ? "MYRIAD-X" : "MYRIAD-2",
|
||||
devicePool.back()->_protocol == NC_USB? "USB" : "PCIe");
|
||||
|
||||
return devicePool.back();
|
||||
@@ -378,7 +369,7 @@ void MyriadExecutor::allocateGraph(DevicePtr &device, GraphDesc &graphDesc,
|
||||
IE_THROW() << "Failed to get output description: " << ncStatusToStr(graphDesc._graphHandle, status);
|
||||
}
|
||||
|
||||
unsigned int fifo_elements = (device->_platform == NC_MYRIAD_2 && executors == 1) ? 4 : 2 * executors;
|
||||
unsigned int fifo_elements = 2 * executors;
|
||||
|
||||
status = ncFifoCreate("input", NC_FIFO_HOST_WO, &graphDesc._inputFifoHandle);
|
||||
if (status != NC_OK) {
|
||||
|
||||
@@ -38,7 +38,6 @@ struct DeviceDesc {
|
||||
int _graphNum = 0;
|
||||
int _maxGraphNum = 0;
|
||||
std::string _name;
|
||||
ncDevicePlatform_t _platform = NC_ANY_PLATFORM;
|
||||
ncDeviceProtocol_t _protocol = NC_ANY_PROTOCOL;
|
||||
|
||||
int _deviceIdx = -1;
|
||||
@@ -63,11 +62,6 @@ struct DeviceDesc {
|
||||
return isSuitableByName &&
|
||||
((config.get<ProtocolOption>() == NC_ANY_PROTOCOL) || (_protocol == config.get<ProtocolOption>()));
|
||||
}
|
||||
|
||||
ncDevicePlatform_t revision() const {
|
||||
VPU_THROW_UNLESS(_platform != NC_ANY_PLATFORM, "Cannot get a revision from not booted device");
|
||||
return _platform;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<DeviceDesc> DevicePtr;
|
||||
|
||||
@@ -40,7 +40,6 @@ IE_SUPPRESS_DEPRECATED_START
|
||||
// deprecated
|
||||
KEY_VPU_CUSTOM_LAYERS,
|
||||
KEY_VPU_MYRIAD_FORCE_RESET,
|
||||
KEY_VPU_MYRIAD_PLATFORM,
|
||||
|
||||
CONFIG_KEY(CONFIG_FILE),
|
||||
};
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
#include <vpu/configuration/options/config_file.hpp>
|
||||
#include <vpu/configuration/options/memory_type.hpp>
|
||||
#include <vpu/configuration/options/enable_force_reset.hpp>
|
||||
#include <vpu/configuration/options/platform.hpp>
|
||||
#include <vpu/configuration/options/check_preprocessing_inside_model.hpp>
|
||||
#include <vpu/configuration/options/enable_early_eltwise_relu_fusion.hpp>
|
||||
#include <vpu/configuration/options/enable_custom_reshape_param.hpp>
|
||||
@@ -165,7 +164,6 @@ QueryNetworkResult Engine::QueryNetwork(
|
||||
|
||||
const auto supportedLayers = getSupportedLayers(
|
||||
network,
|
||||
ncDevicePlatform_t::NC_ANY_PLATFORM,
|
||||
parsedConfigCopy,
|
||||
log,
|
||||
GetCore());
|
||||
@@ -247,7 +245,6 @@ IE_SUPPRESS_DEPRECATED_START
|
||||
_parsedConfig.registerDeprecatedOption<CustomLayersOption>(VPU_CONFIG_KEY(CUSTOM_LAYERS));
|
||||
_parsedConfig.registerDeprecatedOption<MemoryTypeOption>(VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE));
|
||||
_parsedConfig.registerDeprecatedOption<EnableForceResetOption>(VPU_MYRIAD_CONFIG_KEY(FORCE_RESET));
|
||||
_parsedConfig.registerDeprecatedOption<PlatformOption>(VPU_MYRIAD_CONFIG_KEY(PLATFORM));
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
|
||||
@@ -167,8 +167,6 @@ std::vector<std::map<std::string, std::string>> getCorrectConfigs() {
|
||||
{{VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME), CONFIG_VALUE(YES)}},
|
||||
{{VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME), CONFIG_VALUE(NO)}},
|
||||
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)}},
|
||||
|
||||
{{VPU_CONFIG_KEY(DETECT_NETWORK_BATCH), CONFIG_VALUE(YES)}},
|
||||
{{VPU_CONFIG_KEY(DETECT_NETWORK_BATCH), CONFIG_VALUE(NO)}},
|
||||
|
||||
@@ -317,7 +315,6 @@ const std::vector<std::pair<std::string, InferenceEngine::Parameter>>& getDefaul
|
||||
{KEY_CONFIG_FILE, {std::string()}},
|
||||
{InferenceEngine::MYRIAD_DDR_TYPE, {InferenceEngine::MYRIAD_DDR_AUTO}},
|
||||
{InferenceEngine::MYRIAD_ENABLE_FORCE_RESET, {false}},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), {std::string()}},
|
||||
{InferenceEngine::MYRIAD_CHECK_PREPROCESSING_INSIDE_MODEL, {true}},
|
||||
{InferenceEngine::MYRIAD_ENABLE_EARLY_ELTWISE_RELU_FUSION, {true}},
|
||||
{InferenceEngine::MYRIAD_ENABLE_CUSTOM_RESHAPE_PARAM, {false}},
|
||||
@@ -354,9 +351,6 @@ const std::vector<std::tuple<std::string, std::string, InferenceEngine::Paramete
|
||||
std::make_tuple(InferenceEngine::MYRIAD_COPY_OPTIMIZATION, InferenceEngine::PluginConfigParams::NO,
|
||||
InferenceEngine::Parameter{false}),
|
||||
|
||||
std::make_tuple(VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480),
|
||||
InferenceEngine::Parameter{VPU_MYRIAD_CONFIG_VALUE(2480)}),
|
||||
|
||||
std::make_tuple(InferenceEngine::MYRIAD_PROTOCOL, InferenceEngine::MYRIAD_USB,
|
||||
InferenceEngine::Parameter{InferenceEngine::MYRIAD_USB}),
|
||||
std::make_tuple(InferenceEngine::MYRIAD_PROTOCOL, InferenceEngine::MYRIAD_PCIE,
|
||||
@@ -796,10 +790,6 @@ const std::vector<std::map<std::string, std::string>>& getIncorrectConfigs() {
|
||||
{{VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME), "ON"}},
|
||||
{{VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME), "OFF"}},
|
||||
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "-1"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "0"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "1"}},
|
||||
|
||||
{{VPU_CONFIG_KEY(DETECT_NETWORK_BATCH), "ON"}},
|
||||
{{VPU_CONFIG_KEY(DETECT_NETWORK_BATCH), "OFF"}},
|
||||
|
||||
@@ -906,18 +896,6 @@ const std::vector<std::map<std::string, std::string>>& getIncorrectMultiConfigs(
|
||||
{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_MYRIAD},
|
||||
{VPU_CONFIG_KEY(HW_STAGES_OPTIMIZATION), "ON"}
|
||||
},
|
||||
{
|
||||
{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_MYRIAD},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "-1"},
|
||||
},
|
||||
{
|
||||
{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_MYRIAD},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "0"},
|
||||
},
|
||||
{
|
||||
{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_MYRIAD},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "1"},
|
||||
},
|
||||
{
|
||||
{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, CommonTestUtils::DEVICE_MYRIAD},
|
||||
{VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME), "OFF"}
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <vpu/configuration/options/config_file.hpp>
|
||||
#include <vpu/configuration/options/memory_type.hpp>
|
||||
#include <vpu/configuration/options/enable_force_reset.hpp>
|
||||
#include <vpu/configuration/options/platform.hpp>
|
||||
#include <vpu/configuration/options/check_preprocessing_inside_model.hpp>
|
||||
#include <vpu/configuration/options/enable_early_eltwise_relu_fusion.hpp>
|
||||
#include <vpu/configuration/options/enable_custom_reshape_param.hpp>
|
||||
@@ -362,7 +361,7 @@ void GraphTransformerTest::InitCompileEnv() {
|
||||
? InferenceEngine::PluginConfigParams::YES : InferenceEngine::PluginConfigParams::NO);
|
||||
}
|
||||
|
||||
CompileEnv::init(platform, config, _log);
|
||||
CompileEnv::init(config, _log);
|
||||
compileEnvInitialized = true;
|
||||
}
|
||||
|
||||
@@ -452,7 +451,6 @@ IE_SUPPRESS_DEPRECATED_START
|
||||
configuration.registerDeprecatedOption<CustomLayersOption>(VPU_CONFIG_KEY(CUSTOM_LAYERS));
|
||||
configuration.registerDeprecatedOption<MemoryTypeOption>(VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE));
|
||||
configuration.registerDeprecatedOption<EnableForceResetOption>(VPU_MYRIAD_CONFIG_KEY(FORCE_RESET));
|
||||
configuration.registerDeprecatedOption<PlatformOption>(VPU_MYRIAD_CONFIG_KEY(PLATFORM));
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
return configuration;
|
||||
|
||||
@@ -134,7 +134,6 @@ PluginConfiguration createConfiguration();
|
||||
|
||||
class GraphTransformerTest : public ::testing::Test {
|
||||
public:
|
||||
ncDevicePlatform_t platform = ncDevicePlatform_t::NC_MYRIAD_X;
|
||||
PluginConfiguration config;
|
||||
|
||||
StageBuilder::Ptr stageBuilder;
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
ASSERT_NO_THROW(_network = InferenceEngine::CNNNetwork(fn_ptr));
|
||||
|
||||
auto log = std::make_shared<Logger>("GraphCompiler", LogLevel::None, consoleOutput());
|
||||
_compiledGraph = compileNetwork(_network, ncDevicePlatform_t::NC_MYRIAD_X, createConfiguration(), log, _mockCore);
|
||||
_compiledGraph = compileNetwork(_network, createConfiguration(), log, _mockCore);
|
||||
}
|
||||
|
||||
CNNNetwork _network;
|
||||
|
||||
@@ -127,7 +127,6 @@ class AOTBehaviorTests : public BehaviorPluginTest {
|
||||
#endif // _WIN32
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_ANY_PROTOCOL;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ncDeviceOpenParams_t deviceOpenParams = {};
|
||||
deviceOpenParams.watchdogHndl = m_watchdogHndl;
|
||||
|
||||
@@ -28,11 +28,9 @@ MyriadDevicesInfo::MyriadDevicesInfo() {
|
||||
|
||||
std::vector<std::string> MyriadDevicesInfo::getDevicesList(
|
||||
const ncDeviceProtocol_t deviceProtocol,
|
||||
const ncDevicePlatform_t devicePlatform,
|
||||
const XLinkDeviceState_t state) {
|
||||
deviceDesc_t req_deviceDesc = {};
|
||||
req_deviceDesc.protocol = convertProtocolToXlink(deviceProtocol);
|
||||
req_deviceDesc.platform = convertPlatformToXlink(devicePlatform);
|
||||
|
||||
deviceDesc_t deviceDescArray[NC_MAX_DEVICES] = {};
|
||||
unsigned int foundDevices = 0;
|
||||
@@ -49,11 +47,9 @@ std::vector<std::string> MyriadDevicesInfo::getDevicesList(
|
||||
|
||||
int MyriadDevicesInfo::getAmountOfDevices(
|
||||
const ncDeviceProtocol_t deviceProtocol,
|
||||
const ncDevicePlatform_t devicePlatform,
|
||||
const XLinkDeviceState_t state) {
|
||||
deviceDesc_t req_deviceDesc = {};
|
||||
req_deviceDesc.protocol = convertProtocolToXlink(deviceProtocol);
|
||||
req_deviceDesc.platform = convertPlatformToXlink(devicePlatform);
|
||||
|
||||
deviceDesc_t deviceDescArray[NC_MAX_DEVICES] = {};
|
||||
unsigned int foundDevices = 0;
|
||||
|
||||
@@ -29,7 +29,6 @@ public:
|
||||
|
||||
std::vector<std::string> getDevicesList(
|
||||
const ncDeviceProtocol_t deviceProtocol = NC_ANY_PROTOCOL,
|
||||
const ncDevicePlatform_t devicePlatform = NC_ANY_PLATFORM,
|
||||
const XLinkDeviceState_t state = X_LINK_ANY_STATE);
|
||||
|
||||
inline bool isMyriadXDevice(const std::string &device_name);
|
||||
@@ -39,7 +38,6 @@ public:
|
||||
inline bool isMyriadUnbootedDevice(const std::string &device_name);
|
||||
|
||||
int getAmountOfDevices(const ncDeviceProtocol_t deviceProtocol = NC_ANY_PROTOCOL,
|
||||
const ncDevicePlatform_t devicePlatform = NC_ANY_PLATFORM,
|
||||
const XLinkDeviceState_t state = X_LINK_ANY_STATE);
|
||||
|
||||
inline long getAmountOfBootedDevices(const ncDeviceProtocol_t deviceProtocol);
|
||||
@@ -71,9 +69,9 @@ bool MyriadDevicesInfo::isMyriadUnbootedDevice(const std::string &device_name) {
|
||||
}
|
||||
|
||||
long MyriadDevicesInfo::getAmountOfUnbootedDevices(const ncDeviceProtocol_t deviceProtocol) {
|
||||
return getAmountOfDevices(deviceProtocol, NC_ANY_PLATFORM, X_LINK_UNBOOTED);
|
||||
return getAmountOfDevices(deviceProtocol, X_LINK_UNBOOTED);
|
||||
}
|
||||
|
||||
long MyriadDevicesInfo::getAmountOfBootedDevices(const ncDeviceProtocol_t deviceProtocol) {
|
||||
return getAmountOfDevices(deviceProtocol, NC_ANY_PLATFORM, X_LINK_BOOTED);
|
||||
return getAmountOfDevices(deviceProtocol, X_LINK_BOOTED);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ void MyriadLoadNetworkTestCase::LoadNetwork() {
|
||||
}
|
||||
|
||||
bool MyriadLoadNetworkTestCase::IsDeviceAvailable(std::string device_name) {
|
||||
auto act_devices = getDevicesList(NC_ANY_PROTOCOL, NC_ANY_PLATFORM, X_LINK_UNBOOTED);
|
||||
auto act_devices = getDevicesList(NC_ANY_PROTOCOL, X_LINK_UNBOOTED);
|
||||
return std::find(act_devices.begin(), act_devices.end(), device_name) != act_devices.end();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class MYRIADBoot : public MyriadDevicesInfo,
|
||||
* @brief Boot any free device
|
||||
*/
|
||||
void bootOneDevice() {
|
||||
ASSERT_NO_ERROR(ncDeviceLoadFirmware(NC_ANY_PLATFORM, firmwareDir));
|
||||
ASSERT_NO_ERROR(ncDeviceLoadFirmware(firmwareDir));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -84,7 +84,6 @@ class MYRIADWatchdog : public BehaviorPluginTest,
|
||||
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_ANY_PROTOCOL;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ncDeviceOpenParams_t deviceOpenParams = {};
|
||||
deviceOpenParams.watchdogHndl = m_watchdogHndl;
|
||||
|
||||
@@ -81,10 +81,6 @@ const std::vector<BehTestParams> deviceSpecificConfigurations = {
|
||||
BEH_MYRIAD.withConfig({{InferenceEngine::MYRIAD_PROTOCOL, InferenceEngine::MYRIAD_USB}}),
|
||||
BEH_MYRIAD.withConfig({{InferenceEngine::MYRIAD_PROTOCOL, InferenceEngine::MYRIAD_PCIE}}),
|
||||
|
||||
// Deprecated
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2450)}}),
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)}}),
|
||||
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PROTOCOL), VPU_MYRIAD_CONFIG_VALUE(USB)}}),
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PROTOCOL), VPU_MYRIAD_CONFIG_VALUE(PCIE)}}),
|
||||
};
|
||||
@@ -192,17 +188,6 @@ const BehTestParams withIncorrectConfValues[] = {
|
||||
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE), "-1"}}),
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE), "MICRON"}}),
|
||||
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "-1"}}),
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "0"}}),
|
||||
BEH_MYRIAD.withConfig({{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "1"}}),
|
||||
|
||||
BEH_MULTI_CONFIG.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "MYRIAD"},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "-1"}}),
|
||||
BEH_MULTI_CONFIG.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "MYRIAD"},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "0"}}),
|
||||
BEH_MULTI_CONFIG.withConfig({{MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES, "MYRIAD"},
|
||||
{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "1"}}),
|
||||
};
|
||||
|
||||
const BehTestParams withIncorrectConfKeys[] = {
|
||||
|
||||
@@ -197,7 +197,6 @@ TEST_F(myriadConfigsWithBlobImportTests_smoke, TryingToSetRuntimeOptionDoesNotPr
|
||||
{InferenceEngine::MYRIAD_ENABLE_RECEIVING_TENSOR_TIME, CONFIG_VALUE(YES)} };
|
||||
if (vpu::tests::deviceForceReset()) {
|
||||
config.insert({InferenceEngine::MYRIAD_ENABLE_FORCE_RESET, CONFIG_VALUE(NO)});
|
||||
config.insert({VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)});
|
||||
}
|
||||
|
||||
InferenceEngine::ExecutableNetwork importedNetwork;
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <vpu/configuration/options/config_file.hpp>
|
||||
#include <vpu/configuration/options/memory_type.hpp>
|
||||
#include <vpu/configuration/options/enable_force_reset.hpp>
|
||||
#include <vpu/configuration/options/platform.hpp>
|
||||
#include <vpu/configuration/options/check_preprocessing_inside_model.hpp>
|
||||
#include <vpu/configuration/options/enable_early_eltwise_relu_fusion.hpp>
|
||||
#include <vpu/configuration/options/enable_custom_reshape_param.hpp>
|
||||
@@ -66,12 +65,11 @@ void graphTransformerFunctionalTests::SetUp() {
|
||||
vpuLayersTests::SetUp();
|
||||
|
||||
_stageBuilder = std::make_shared<StageBuilder>();
|
||||
_platform = CheckMyriadX() ? ncDevicePlatform_t::NC_MYRIAD_X : ncDevicePlatform_t::NC_MYRIAD_2;
|
||||
}
|
||||
|
||||
void graphTransformerFunctionalTests::CreateModel() {
|
||||
const auto compilerLog = std::make_shared<Logger>("Test", LogLevel::Info, consoleOutput());
|
||||
CompileEnv::init(_platform, _configuration, compilerLog);
|
||||
CompileEnv::init(_configuration, compilerLog);
|
||||
AutoScope autoDeinit([] {
|
||||
CompileEnv::free();
|
||||
});
|
||||
@@ -147,7 +145,6 @@ IE_SUPPRESS_DEPRECATED_START
|
||||
_configuration.registerDeprecatedOption<CustomLayersOption>(VPU_CONFIG_KEY(CUSTOM_LAYERS));
|
||||
_configuration.registerDeprecatedOption<MemoryTypeOption>(VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE));
|
||||
_configuration.registerDeprecatedOption<EnableForceResetOption>(VPU_MYRIAD_CONFIG_KEY(FORCE_RESET));
|
||||
_configuration.registerDeprecatedOption<PlatformOption>(VPU_MYRIAD_CONFIG_KEY(PLATFORM));
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
_inputsInfo.clear();
|
||||
@@ -192,7 +189,6 @@ int64_t graphTransformerFunctionalTests::CompileAndInfer(Blob::Ptr& inputBlob, B
|
||||
|
||||
auto compiledGraph = compileModel(
|
||||
_gtModel,
|
||||
_platform,
|
||||
_configuration,
|
||||
compilerLog);
|
||||
|
||||
|
||||
@@ -31,6 +31,5 @@ protected:
|
||||
vpu::Data _dataIntermediate;
|
||||
|
||||
private:
|
||||
ncDevicePlatform_t _platform = ncDevicePlatform_t::NC_MYRIAD_X;
|
||||
InferenceEngine::ExecutableNetwork _executableNetwork;
|
||||
};
|
||||
|
||||
@@ -58,18 +58,6 @@ TEST_P(myriadIncorrectModelsConfigsTests_nightly, LoadNetworkWithIncorrectConfig
|
||||
// Tests initiation
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
static const std::vector<config_t> myriadCorrectPlatformConfigValues = {
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2450)}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), ""}}
|
||||
};
|
||||
|
||||
static const std::vector<config_t> myriadIncorrectPlatformConfigValues = {
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "-1"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), " 0"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "MyriadX"}}
|
||||
};
|
||||
|
||||
static const std::vector<config_t> myriadCorrectPackageTypeConfigValues = {
|
||||
// Please do not use other types of DDR in tests with a real device, because it may hang.
|
||||
{{InferenceEngine::MYRIAD_DDR_TYPE, InferenceEngine::MYRIAD_DDR_AUTO}},
|
||||
@@ -87,12 +75,6 @@ static const std::vector<config_t> myriadIncorrectPackageTypeConfigValues = {
|
||||
{{VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE), "-MICRON_1GB"}},
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(MyriadConfigs, myriadCorrectModelsConfigsTests_nightly,
|
||||
::testing::ValuesIn(myriadCorrectPlatformConfigValues));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(MyriadConfigs, myriadIncorrectModelsConfigsTests_nightly,
|
||||
::testing::ValuesIn(myriadIncorrectPlatformConfigValues));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(MyriadPackageConfigs, myriadCorrectModelsConfigsTests_nightly,
|
||||
::testing::ValuesIn(myriadCorrectPackageTypeConfigValues));
|
||||
|
||||
|
||||
@@ -62,16 +62,8 @@ static bool hasMyriad2() {
|
||||
static bool hasAppropriateStick(const config_t &config) {
|
||||
bool suitsConfig;
|
||||
|
||||
auto platform = config.find(VPU_MYRIAD_CONFIG_KEY(PLATFORM));
|
||||
if (platform == config.end() || platform->second.empty()) {
|
||||
suitsConfig = hasMyriad2() || hasMyriadX();
|
||||
} else {
|
||||
bool hasRequestedMyriad2 =
|
||||
platform->second == VPU_MYRIAD_CONFIG_VALUE(2450) && hasMyriad2();
|
||||
bool hasRequestedMyriadX =
|
||||
platform->second == VPU_MYRIAD_CONFIG_VALUE(2480) && hasMyriadX();
|
||||
suitsConfig = hasRequestedMyriad2 || hasRequestedMyriadX;
|
||||
}
|
||||
bool hasRequestedMyriadX = hasMyriadX();
|
||||
suitsConfig = hasRequestedMyriadX;
|
||||
|
||||
return suitsConfig;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
#include <vpu/configuration/options/config_file.hpp>
|
||||
#include <vpu/configuration/options/memory_type.hpp>
|
||||
#include <vpu/configuration/options/enable_force_reset.hpp>
|
||||
#include <vpu/configuration/options/platform.hpp>
|
||||
#include <vpu/configuration/options/check_preprocessing_inside_model.hpp>
|
||||
#include <vpu/configuration/options/enable_early_eltwise_relu_fusion.hpp>
|
||||
#include <vpu/configuration/options/enable_custom_reshape_param.hpp>
|
||||
@@ -264,7 +263,6 @@ IE_SUPPRESS_DEPRECATED_START
|
||||
configuration.registerDeprecatedOption<CustomLayersOption>(VPU_CONFIG_KEY(CUSTOM_LAYERS));
|
||||
configuration.registerDeprecatedOption<MemoryTypeOption>(VPU_MYRIAD_CONFIG_KEY(MOVIDIUS_DDR_TYPE));
|
||||
configuration.registerDeprecatedOption<EnableForceResetOption>(VPU_MYRIAD_CONFIG_KEY(FORCE_RESET));
|
||||
configuration.registerDeprecatedOption<PlatformOption>(VPU_MYRIAD_CONFIG_KEY(PLATFORM));
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
return configuration;
|
||||
@@ -310,7 +308,7 @@ void GraphTransformerTest::InitCompileEnv() {
|
||||
? InferenceEngine::PluginConfigParams::YES : InferenceEngine::PluginConfigParams::NO);
|
||||
}
|
||||
|
||||
CompileEnv::init(platform, config, _log);
|
||||
CompileEnv::init(config, _log);
|
||||
compileEnvInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,6 @@ PluginConfiguration createConfiguration();
|
||||
|
||||
class GraphTransformerTest : public TestsCommon {
|
||||
public:
|
||||
ncDevicePlatform_t platform = ncDevicePlatform_t::NC_MYRIAD_X;
|
||||
PluginConfiguration config;
|
||||
|
||||
StageBuilder::Ptr stageBuilder;
|
||||
|
||||
@@ -22,20 +22,6 @@ TEST_P(MyriadEngineSetIncorrectConfigTest, SetIncorrectConfig) {
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
static const std::vector<config_t> myriadCorrectPlatformConfigValues = {
|
||||
// Deprecated
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2450)}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), VPU_MYRIAD_CONFIG_VALUE(2480)}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), ""}}
|
||||
};
|
||||
|
||||
static const std::vector<config_t> myriadIncorrectPlatformConfigValues = {
|
||||
// Deprecated
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "-1"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), " 0"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PLATFORM), "MyriadX"}}
|
||||
};
|
||||
|
||||
static const std::vector<config_t> myriadCorrectProtocolConfigValues = {
|
||||
{{InferenceEngine::MYRIAD_PROTOCOL, InferenceEngine::MYRIAD_PCIE}},
|
||||
{{InferenceEngine::MYRIAD_PROTOCOL, InferenceEngine::MYRIAD_USB}},
|
||||
@@ -50,12 +36,10 @@ static const std::vector<config_t> myriadCorrectProtocolConfigValues = {
|
||||
static const std::vector<config_t> myriadIncorrectProtocolConfigValues = {
|
||||
// Protocols
|
||||
{{InferenceEngine::MYRIAD_PROTOCOL, "0"}},
|
||||
{{InferenceEngine::MYRIAD_PROTOCOL, "2450"}},
|
||||
{{InferenceEngine::MYRIAD_PROTOCOL, "PCI"}},
|
||||
|
||||
// Deprecated
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PROTOCOL), "0"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PROTOCOL), "2450"}},
|
||||
{{VPU_MYRIAD_CONFIG_KEY(PROTOCOL), "PCI"}},
|
||||
};
|
||||
|
||||
@@ -106,13 +90,6 @@ static const std::vector<config_t> myriadIncorrectPackageTypeConfigValues = {
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
/// Platform
|
||||
INSTANTIATE_TEST_SUITE_P(MyriadPlatformConfigs, MyriadEngineSetCorrectConfigTest,
|
||||
::testing::ValuesIn(myriadCorrectPlatformConfigValues));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(MyriadPlatformConfigs, MyriadEngineSetIncorrectConfigTest,
|
||||
::testing::ValuesIn(myriadIncorrectPlatformConfigValues));
|
||||
|
||||
/// Protocol
|
||||
INSTANTIATE_TEST_SUITE_P(MyriadProtocolConfigs, MyriadEngineSetCorrectConfigTest,
|
||||
::testing::ValuesIn(myriadCorrectProtocolConfigValues));
|
||||
|
||||
@@ -124,12 +124,6 @@ typedef enum {
|
||||
NC_RW_ENABLE_ASYNC_DMA = 2102 // enable/disable asynchronous DMA on device
|
||||
} ncDeviceOption_t;
|
||||
|
||||
typedef enum {
|
||||
NC_ANY_PLATFORM = 0,
|
||||
NC_MYRIAD_2 = 2450,
|
||||
NC_MYRIAD_X = 2480,
|
||||
} ncDevicePlatform_t;
|
||||
|
||||
typedef enum {
|
||||
NC_ANY_PROTOCOL = 0,
|
||||
NC_USB,
|
||||
@@ -158,7 +152,6 @@ struct ncDeviceHandle_t {
|
||||
|
||||
struct ncDeviceDescr_t {
|
||||
ncDeviceProtocol_t protocol;
|
||||
ncDevicePlatform_t platform;
|
||||
char name[NC_MAX_NAME_SIZE];
|
||||
};
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ extern "C"
|
||||
XLinkProtocol_t convertProtocolToXlink(const ncDeviceProtocol_t ncProtocol);
|
||||
ncDeviceProtocol_t convertProtocolToNC(const XLinkProtocol_t xLinkProtocol);
|
||||
|
||||
XLinkPlatform_t convertPlatformToXlink(const ncDevicePlatform_t ncProtocol);
|
||||
ncDevicePlatform_t convertPlatformToNC(const XLinkPlatform_t xLinkProtocol);
|
||||
XLinkPlatform_t convertPlatformToXlink();
|
||||
|
||||
int copyNcDeviceDescrToXLink(
|
||||
const struct ncDeviceDescr_t *in_ncDeviceDesc, deviceDesc_t *out_deviceDesc);
|
||||
|
||||
@@ -16,14 +16,14 @@ extern "C"
|
||||
* @param devicePlatform Platform to boot
|
||||
* @param customFirmwareDir Path to directory with firmware to load. If NULL, use default
|
||||
*/
|
||||
MVNC_EXPORT_API ncStatus_t ncDeviceLoadFirmware(const ncDevicePlatform_t devicePlatform, const char* customFirmwareDir);
|
||||
MVNC_EXPORT_API ncStatus_t ncDeviceLoadFirmware(const char* customFirmwareDir);
|
||||
|
||||
/**
|
||||
* @brief Reset all devices
|
||||
*/
|
||||
MVNC_EXPORT_API ncStatus_t ncDeviceResetAll();
|
||||
|
||||
MVNC_EXPORT_API char* ncPlatformToStr(ncDevicePlatform_t devicePlatform);
|
||||
MVNC_EXPORT_API char* ncPlatformToStr();
|
||||
MVNC_EXPORT_API char* ncProtocolToStr(ncDeviceProtocol_t deviceProtocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -150,12 +150,8 @@ char* ncProtocolToStr(const ncDeviceProtocol_t deviceProtocol) {
|
||||
}
|
||||
}
|
||||
|
||||
char* ncPlatformToStr(const ncDevicePlatform_t platform) {
|
||||
switch(platform) {
|
||||
case NC_MYRIAD_2: return "NC_MYRIAD_2";
|
||||
case NC_MYRIAD_X: return "NC_MYRIAD_X";
|
||||
default: return "NC_ANY_PLATFORM";
|
||||
}
|
||||
char* ncPlatformToStr() {
|
||||
return "NC_MYRIAD_X";
|
||||
}
|
||||
|
||||
int mvnc_memcpy(void* dest, size_t destsz, void const* src, size_t count) {
|
||||
@@ -1186,21 +1182,20 @@ ncStatus_t ncAvailableDevices(struct ncDeviceDescr_t *deviceDescrPtr,
|
||||
return NC_OK;
|
||||
}
|
||||
|
||||
ncStatus_t ncDeviceLoadFirmware(const ncDevicePlatform_t devicePlatform, const char* customFirmwareDir) {
|
||||
mvLog(MVLOG_WARN, "Boot (%s) without connecting to it", ncPlatformToStr(devicePlatform));
|
||||
ncStatus_t ncDeviceLoadFirmware(const char* customFirmwareDir) {
|
||||
mvLog(MVLOG_WARN, "Boot (%s) without connecting to it", "");
|
||||
XLinkError_t rc;
|
||||
ncStatus_t sc;
|
||||
|
||||
// Find device with specific platform
|
||||
deviceDesc_t deviceDesc = {0};
|
||||
deviceDesc_t in_deviceDesc = {
|
||||
.platform = convertPlatformToXlink(devicePlatform),
|
||||
.protocol = X_LINK_USB_VSC
|
||||
};
|
||||
|
||||
rc = XLinkFindFirstSuitableDevice(X_LINK_UNBOOTED, in_deviceDesc, &deviceDesc);
|
||||
if (rc) {
|
||||
mvLog(MVLOG_WARN, "Failed to find (%s) platform device", ncPlatformToStr(devicePlatform));
|
||||
mvLog(MVLOG_WARN, "Failed to find (%s) platform device", "");
|
||||
return NC_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -2668,14 +2663,7 @@ static ncStatus_t getDeviceOption(struct _devicePrivate_t *d,
|
||||
mv_strncpy((char *) data, *dataLength, d->dev_addr, *dataLength - 1);
|
||||
break;
|
||||
case NC_RO_DEVICE_PLATFORM:
|
||||
if (d->dev_attr.fw_version[1] == 0x2480){
|
||||
*(ncDevicePlatform_t *) data = NC_MYRIAD_X;
|
||||
} else if (d->dev_attr.fw_version[1] == 0x2450) {
|
||||
*(ncDevicePlatform_t *) data = NC_MYRIAD_2;
|
||||
} else {
|
||||
*(ncDevicePlatform_t *) data = NC_ANY_PLATFORM;
|
||||
}
|
||||
*dataLength = sizeof(ncDevicePlatform_t);
|
||||
*dataLength = sizeof(data);
|
||||
break;
|
||||
case NC_RO_DEVICE_PROTOCOL:
|
||||
*(ncDeviceProtocol_t *) data = convertProtocolToNC(d->protocol);
|
||||
@@ -2821,7 +2809,7 @@ ncStatus_t ncDeviceGetOption(struct ncDeviceHandle_t * deviceHandle,
|
||||
CHECK_HANDLE_CORRECT(deviceHandle);
|
||||
ncStatus_t rc;
|
||||
|
||||
if (!dataLength || (*dataLength != 0 && !data)) {
|
||||
if (!dataLength) {
|
||||
mvLog(MVLOG_ERROR, "Some of the parameters are NULL");
|
||||
return NC_INVALID_PARAMETERS;
|
||||
}
|
||||
|
||||
@@ -35,35 +35,12 @@ ncDeviceProtocol_t convertProtocolToNC(
|
||||
}
|
||||
}
|
||||
|
||||
XLinkPlatform_t convertPlatformToXlink(
|
||||
const ncDevicePlatform_t ncProtocol) {
|
||||
switch (ncProtocol) {
|
||||
case NC_ANY_PLATFORM: return X_LINK_ANY_PLATFORM;
|
||||
case NC_MYRIAD_2: return X_LINK_MYRIAD_2;
|
||||
case NC_MYRIAD_X: return X_LINK_MYRIAD_X;
|
||||
default: return X_LINK_ANY_PLATFORM;
|
||||
}
|
||||
}
|
||||
|
||||
ncDevicePlatform_t convertPlatformToNC(
|
||||
const XLinkPlatform_t xLinkProtocol) {
|
||||
switch (xLinkProtocol) {
|
||||
case X_LINK_ANY_PLATFORM: return NC_ANY_PLATFORM;
|
||||
case X_LINK_MYRIAD_2: return NC_MYRIAD_2;
|
||||
case X_LINK_MYRIAD_X: return NC_MYRIAD_X;
|
||||
default:
|
||||
mvLog(MVLOG_WARN, "This convertation not supported, set to NC_ANY_PLATFORM");
|
||||
return NC_ANY_PLATFORM;
|
||||
}
|
||||
}
|
||||
|
||||
int copyNcDeviceDescrToXLink(const struct ncDeviceDescr_t *in_ncDeviceDesc,
|
||||
deviceDesc_t *out_deviceDesc) {
|
||||
CHECK_HANDLE_CORRECT(in_ncDeviceDesc);
|
||||
CHECK_HANDLE_CORRECT(out_deviceDesc);
|
||||
|
||||
out_deviceDesc->protocol = convertProtocolToXlink(in_ncDeviceDesc->protocol);
|
||||
out_deviceDesc->platform = convertPlatformToXlink(in_ncDeviceDesc->platform);
|
||||
mv_strncpy(out_deviceDesc->name, XLINK_MAX_NAME_SIZE, in_ncDeviceDesc->name, XLINK_MAX_NAME_SIZE - 1);
|
||||
|
||||
return NC_OK;
|
||||
@@ -75,7 +52,6 @@ int copyXLinkDeviceDescrToNc(const deviceDesc_t *in_DeviceDesc,
|
||||
CHECK_HANDLE_CORRECT(out_ncDeviceDesc);
|
||||
|
||||
out_ncDeviceDesc->protocol = convertProtocolToNC(in_DeviceDesc->protocol);
|
||||
out_ncDeviceDesc->platform = convertPlatformToNC(in_DeviceDesc->platform);
|
||||
mv_strncpy(out_ncDeviceDesc->name, XLINK_MAX_NAME_SIZE, in_DeviceDesc->name, XLINK_MAX_NAME_SIZE - 1);
|
||||
|
||||
return NC_OK;
|
||||
|
||||
@@ -57,7 +57,6 @@ void MvncTestsCommon::openDevices(const int devicesToBoot, ncDeviceHandle_t **de
|
||||
amountOfBooted = 0;
|
||||
ncDeviceDescr_t ncDeviceDesc = {};
|
||||
ncDeviceDesc.protocol = NC_USB;
|
||||
ncDeviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
for (int index = 0; index < devicesToBoot; ++index) {
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandlers[index], ncDeviceDesc, m_ncDeviceOpenParams));
|
||||
@@ -71,7 +70,7 @@ void MvncTestsCommon::bootOneDevice(ncDeviceProtocol_t deviceProtocol) {
|
||||
if (deviceProtocol == NC_PCIE) {
|
||||
GTEST_FATAL_FAILURE_("Boot doesn't supported for PCIe protocol\n");
|
||||
}
|
||||
ASSERT_NO_ERROR(ncDeviceLoadFirmware(NC_ANY_PLATFORM, firmwareDir));
|
||||
ASSERT_NO_ERROR(ncDeviceLoadFirmware(firmwareDir));
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +122,6 @@ void MvncLoggingTests::SetUp() {
|
||||
MvncOpenDevice::SetUp();
|
||||
|
||||
_deviceDesc.protocol = _deviceProtocol;
|
||||
_deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
for (int index = 0; index < availableDevices_; ++index) {
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&_deviceHandles[index], _deviceDesc, m_ncDeviceOpenParams));
|
||||
|
||||
@@ -137,12 +137,6 @@ static const std::vector<ncDeviceProtocol_t> myriadProtocols = {
|
||||
NC_PCIE
|
||||
};
|
||||
|
||||
static const std::vector<ncDevicePlatform_t> myriadPlatforms = {
|
||||
NC_MYRIAD_2,
|
||||
NC_MYRIAD_X
|
||||
};
|
||||
|
||||
|
||||
namespace {
|
||||
/**
|
||||
* @brief Converter from enum to string
|
||||
@@ -153,9 +147,8 @@ namespace {
|
||||
return ncProtocolToStr(info.param);
|
||||
}
|
||||
|
||||
std::string operator()(
|
||||
const ::testing::TestParamInfo<ncDevicePlatform_t> &info) const {
|
||||
return std::string("USB_") + ncPlatformToStr(info.param);
|
||||
std::string operator()() const {
|
||||
return std::string("USB_");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ void MvncOpenUSBDevice::SetUp() {
|
||||
availableDevices_ = getAmountOfNotBootedDevices(NC_USB);
|
||||
|
||||
deviceDesc_.protocol = NC_USB;
|
||||
deviceDesc_.platform = NC_ANY_PLATFORM;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -29,12 +29,11 @@ class MvncCloseUSBDevice : public MvncOpenUSBDevice {
|
||||
//------------------------------------------------------------------------------
|
||||
// class MvncDevicePlatform
|
||||
//------------------------------------------------------------------------------
|
||||
class MvncDevicePlatform : public MvncOpenUSBDevice,
|
||||
public testing::WithParamInterface<ncDevicePlatform_t>{
|
||||
class MvncDevicePlatform : public MvncOpenUSBDevice
|
||||
{
|
||||
public:
|
||||
long available_myriadX_ = 0;
|
||||
long available_myriad2_ = 0;
|
||||
ncDevicePlatform_t devicePlatform_;
|
||||
|
||||
~MvncDevicePlatform() override = default;
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
// Implementations of helpers - counters
|
||||
//------------------------------------------------------------------------------
|
||||
int getAmountOfDevices(const ncDeviceProtocol_t deviceProtocol,
|
||||
const ncDevicePlatform_t devicePlatform,
|
||||
const XLinkDeviceState_t state) {
|
||||
deviceDesc_t req_deviceDesc = {};
|
||||
req_deviceDesc.protocol = convertProtocolToXlink(deviceProtocol);
|
||||
req_deviceDesc.platform = convertPlatformToXlink(devicePlatform);
|
||||
|
||||
deviceDesc_t deviceDescArray[NC_MAX_DEVICES] = {};
|
||||
unsigned int foundDevices = 0;
|
||||
@@ -24,22 +22,6 @@ int getAmountOfDevices(const ncDeviceProtocol_t deviceProtocol,
|
||||
return foundDevices;
|
||||
}
|
||||
|
||||
long getAmountOfMyriadXDevices(ncDeviceProtocol_t deviceProtocol) {
|
||||
return getAmountOfDevices(deviceProtocol, NC_MYRIAD_X);
|
||||
}
|
||||
|
||||
long getAmountOfMyriad2Devices(ncDeviceProtocol_t deviceProtocol) {
|
||||
return getAmountOfDevices(deviceProtocol, NC_MYRIAD_2);
|
||||
}
|
||||
|
||||
long getAmountOfBootedDevices(ncDeviceProtocol_t deviceProtocol) {
|
||||
return getAmountOfDevices(deviceProtocol, NC_ANY_PLATFORM, X_LINK_BOOTED);
|
||||
}
|
||||
|
||||
long getAmountOfNotBootedDevices(ncDeviceProtocol_t deviceProtocol) {
|
||||
return getAmountOfDevices(deviceProtocol, NC_ANY_PLATFORM, X_LINK_UNBOOTED);
|
||||
}
|
||||
|
||||
long getAmountOfPCIeDevices() {
|
||||
return getAmountOfDevices(NC_PCIE);
|
||||
}
|
||||
@@ -52,12 +34,10 @@ long getAmountOfUSBDevices() {
|
||||
// Implementations of helpers - get devices
|
||||
//------------------------------------------------------------------------------
|
||||
std::vector<std::string> getDevicesList(const ncDeviceProtocol_t deviceProtocol,
|
||||
const ncDevicePlatform_t devicePlatform,
|
||||
const XLinkDeviceState_t state) {
|
||||
|
||||
deviceDesc_t req_deviceDesc = {};
|
||||
req_deviceDesc.protocol = convertProtocolToXlink(deviceProtocol);
|
||||
req_deviceDesc.platform = convertPlatformToXlink(devicePlatform);
|
||||
|
||||
deviceDesc_t deviceDescArray[NC_MAX_DEVICES] = {};
|
||||
unsigned int foundDevices = 0;
|
||||
@@ -112,16 +92,8 @@ bool isSameProtocolDevice(const std::string &deviceName, const ncDeviceProtocol_
|
||||
}
|
||||
|
||||
bool
|
||||
isSamePlatformUSBDevice(const std::string &deviceName, const ncDevicePlatform_t expectedPlatform) {
|
||||
switch (expectedPlatform) {
|
||||
case NC_MYRIAD_2: return isMyriad2USBDevice(deviceName);
|
||||
case NC_MYRIAD_X: return isMyriadXUSBDevice(deviceName);
|
||||
case NC_ANY_PLATFORM:
|
||||
return isMyriad2USBDevice(deviceName) || isMyriadXUSBDevice(deviceName);
|
||||
default:
|
||||
std::cout << "Unknown device platform" << std::endl;
|
||||
return false;
|
||||
}
|
||||
isSamePlatformUSBDevice(const std::string &deviceName) {
|
||||
return isMyriadXUSBDevice(deviceName);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -56,7 +56,6 @@ extern "C" void initialize_usb_boot();
|
||||
* @param[in] deviceProtocol Count only platform specific devices
|
||||
*/
|
||||
int getAmountOfDevices(const ncDeviceProtocol_t deviceProtocol = NC_ANY_PROTOCOL,
|
||||
const ncDevicePlatform_t devicePlatform = NC_ANY_PLATFORM,
|
||||
const XLinkDeviceState_t state = X_LINK_ANY_STATE);
|
||||
|
||||
long getAmountOfMyriadXDevices(ncDeviceProtocol_t deviceProtocol = NC_ANY_PROTOCOL);
|
||||
@@ -79,7 +78,6 @@ long getAmountOfUSBDevices();
|
||||
*/
|
||||
std::vector<std::string> getDevicesList(
|
||||
const ncDeviceProtocol_t deviceProtocol = NC_ANY_PROTOCOL,
|
||||
const ncDevicePlatform_t devicePlatform = NC_ANY_PLATFORM,
|
||||
const XLinkDeviceState_t state = X_LINK_ANY_STATE);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -107,8 +105,7 @@ bool isSameProtocolDevice(const std::string &deviceName,
|
||||
/**
|
||||
* @brief Check that device matches the specified platform for USB
|
||||
*/
|
||||
bool isSamePlatformUSBDevice(const std::string &deviceName,
|
||||
const ncDevicePlatform_t expectedPlatform);
|
||||
bool isSamePlatformUSBDevice(const std::string &deviceName);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers - file loader
|
||||
|
||||
@@ -15,7 +15,6 @@ TEST_F(MvncNoBootOpenDevice, OpenAndClose) {
|
||||
ncDeviceHandle_t *deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_USB;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, watchdogInterval, firmwarePath));
|
||||
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle));
|
||||
@@ -28,7 +27,6 @@ TEST_F(MvncNoBootOpenDevice, OpenTwiceSameHandler) {
|
||||
ncDeviceHandle_t *deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_USB;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
char dev_addr_first_open[MAX_DEV_NAME];
|
||||
unsigned int data_length_first = MAX_DEV_NAME;
|
||||
@@ -60,7 +58,6 @@ TEST_F(MvncNoBootOpenDevice, OpenDeviceWithOneXLinkInitializion) {
|
||||
ncDeviceHandle_t *deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_USB;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, watchdogInterval, firmwarePath));
|
||||
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle));
|
||||
@@ -93,7 +90,6 @@ TEST_F(MvncNoBootCloseDevice, AlreadyBootedDeviceWillNotReboot) {
|
||||
ncDeviceHandle_t *deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_USB;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, watchdogInterval, firmwarePath));
|
||||
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle));
|
||||
|
||||
@@ -19,7 +19,6 @@ TEST_P(MvncStressTests, OpenClose1001) {
|
||||
ncDeviceHandle_t *deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
for (int i = 0; i < iterations; ++i) {
|
||||
printf("Iteration %d of %d\n", i, iterations);
|
||||
@@ -36,7 +35,6 @@ TEST_P(MvncStressTests, AllocateDeallocateGraph1001) {
|
||||
const int iterations = 1001;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
// Load graph
|
||||
const std::string blobPath = "bvlc_googlenet_fp16.blob";
|
||||
@@ -79,7 +77,6 @@ TEST_P(MvncStressTests, FullCycleOfWork101Times) {
|
||||
const int iterations = 101;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
const std::string blobPath = "bvlc_googlenet_fp16.blob";
|
||||
std::vector<char> blob;
|
||||
|
||||
@@ -92,7 +92,6 @@ TEST_F(MvncTestsCommon, OpenUSBThenPCIEAndClose) {
|
||||
std::string actDeviceName;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_USB;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle_USB, deviceDesc, m_ncDeviceOpenParams));
|
||||
|
||||
@@ -127,7 +126,6 @@ TEST_F(MvncTestsCommon, OpenPCIEThenUSBAndClose) {
|
||||
std::string actDeviceName;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_PCIE;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
// Open PCIe device
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle_PCIe, deviceDesc, m_ncDeviceOpenParams));
|
||||
@@ -164,7 +162,6 @@ TEST_P(MvncOpenDevice, OpenAndClose) {
|
||||
std::string deviceName;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, m_ncDeviceOpenParams));
|
||||
|
||||
@@ -190,7 +187,6 @@ TEST_P(MvncOpenDevice, AllHandleFieldsInitialized) {
|
||||
ncDeviceHandle_t* deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, m_ncDeviceOpenParams));
|
||||
|
||||
@@ -217,7 +213,6 @@ TEST_P(MvncOpenDevice, OpenTwiceSameHandler) {
|
||||
ncDeviceHandle_t *deviceHandle = nullptr;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
char dev_addr_first_open[MAX_DEV_NAME];
|
||||
unsigned int data_length_first = MAX_DEV_NAME;
|
||||
@@ -254,7 +249,6 @@ TEST_P(MvncOpenDevice, DISABLED_OpenSameDeviceTwiceDifferentHandlers) {
|
||||
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle1, deviceDesc, m_ncDeviceOpenParams));
|
||||
|
||||
@@ -278,7 +272,6 @@ TEST_P(MvncOpenDevice, OpenTwiceWithOneXLinkInitializion) {
|
||||
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = _deviceProtocol;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, m_ncDeviceOpenParams));
|
||||
|
||||
@@ -304,8 +297,7 @@ TEST_P(MvncOpenDevice, WatchdogShouldResetDeviceWithoutConnection) {
|
||||
deviceDesc_t deviceDescToBoot = {};
|
||||
deviceDesc_t in_deviceDesc = {};
|
||||
in_deviceDesc.protocol = convertProtocolToXlink(_deviceProtocol);
|
||||
in_deviceDesc.platform = convertPlatformToXlink(NC_ANY_PLATFORM);
|
||||
int expectAvailableDevices = getAmountOfDevices(_deviceProtocol, NC_ANY_PLATFORM, X_LINK_UNBOOTED);
|
||||
int expectAvailableDevices = getAmountOfDevices(_deviceProtocol, X_LINK_UNBOOTED);
|
||||
|
||||
XLinkError_t rc = X_LINK_ERROR;
|
||||
auto waittm = std::chrono::system_clock::now() + std::chrono::seconds(5);
|
||||
@@ -321,11 +313,11 @@ TEST_P(MvncOpenDevice, WatchdogShouldResetDeviceWithoutConnection) {
|
||||
|
||||
std::this_thread::sleep_for(5_sec);
|
||||
ASSERT_EQ(expectAvailableDevices - 1,
|
||||
getAmountOfDevices(_deviceProtocol, NC_ANY_PLATFORM, X_LINK_UNBOOTED));
|
||||
getAmountOfDevices(_deviceProtocol, X_LINK_UNBOOTED));
|
||||
|
||||
std::this_thread::sleep_for(15_sec);
|
||||
ASSERT_EQ(expectAvailableDevices,
|
||||
getAmountOfDevices(_deviceProtocol, NC_ANY_PLATFORM, X_LINK_UNBOOTED));
|
||||
getAmountOfDevices(_deviceProtocol, X_LINK_UNBOOTED));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@ TEST_F(MvncOpenUSBDevice, ShouldOpenDeviceAfterChangeConnectTimeoutFromZero) {
|
||||
std::string actDeviceName;
|
||||
ncDeviceDescr_t deviceDesc = {};
|
||||
deviceDesc.protocol = NC_ANY_PROTOCOL;
|
||||
deviceDesc.platform = NC_ANY_PLATFORM;
|
||||
|
||||
ASSERT_NO_ERROR(ncSetDeviceConnectTimeout(0));
|
||||
ASSERT_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, m_ncDeviceOpenParams));
|
||||
@@ -175,19 +174,10 @@ TEST_F(MvncOpenUSBDevice, CheckErrorWhenPlatformConflictWithName) {
|
||||
if (availableDevices_ == 0)
|
||||
GTEST_SKIP();
|
||||
|
||||
ncDevicePlatform_t wrongPlatform = NC_ANY_PLATFORM;
|
||||
auto availableDevices = getDevicesList();
|
||||
|
||||
ASSERT_TRUE(availableDevices.size());
|
||||
|
||||
if(isMyriadXUSBDevice(availableDevices[0])) {
|
||||
wrongPlatform = NC_MYRIAD_2;
|
||||
} else {
|
||||
wrongPlatform = NC_MYRIAD_X;
|
||||
}
|
||||
|
||||
strncpy(deviceDesc_.name, availableDevices[0].c_str(), NC_MAX_NAME_SIZE);
|
||||
deviceDesc_.platform = wrongPlatform;
|
||||
|
||||
ASSERT_ERROR(ncDeviceOpen(&deviceHandle_, deviceDesc_, m_ncDeviceOpenParams));
|
||||
}
|
||||
@@ -236,7 +226,7 @@ TEST_P(MvncDevicePlatform, OpenAndClose) {
|
||||
unsigned int size = MAX_DEV_NAME;
|
||||
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle_, NC_RO_DEVICE_NAME, deviceName, &size));
|
||||
|
||||
EXPECT_TRUE(isSamePlatformUSBDevice(deviceName, devicePlatform_));
|
||||
EXPECT_TRUE(isSamePlatformUSBDevice(deviceName));
|
||||
|
||||
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle_, m_watchdogHndl));
|
||||
|
||||
|
||||
@@ -184,10 +184,6 @@ static std::map<std::string, std::string> configure() {
|
||||
auto config = parseConfigFile();
|
||||
|
||||
if (isMYRIAD) {
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
config[VPU_MYRIAD_CONFIG_KEY(PLATFORM)] = "VPU_MYRIAD_2480";
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
if (!FLAGS_VPU_NUMBER_OF_SHAVES.empty()) {
|
||||
config[InferenceEngine::MYRIAD_NUMBER_OF_SHAVES] = FLAGS_VPU_NUMBER_OF_SHAVES;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user