mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #19632 from l-bat:lb/ie_arm_target
Added OpenVINO ARM target * Added IE ARM target * Added OpenVINO ARM target * Delete ARM target * Detect ARM platform * Changed device name in ArmPlugin * Change ARM detection
This commit is contained in:
@@ -651,6 +651,22 @@ InferenceEngine::Core& getCore(const std::string& id)
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool detectArmPlugin_()
|
||||
{
|
||||
InferenceEngine::Core& ie = getCore("CPU");
|
||||
const std::vector<std::string> devices = ie.GetAvailableDevices();
|
||||
for (std::vector<std::string>::const_iterator i = devices.begin(); i != devices.end(); ++i)
|
||||
{
|
||||
if (i->find("CPU") != std::string::npos)
|
||||
{
|
||||
const std::string name = ie.GetMetric(*i, METRIC_KEY(FULL_DEVICE_NAME)).as<std::string>();
|
||||
CV_LOG_INFO(NULL, "CPU plugin: " << name);
|
||||
return name.find("arm_compute::NEON") != std::string::npos;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined(OPENCV_DNN_IE_VPU_TYPE_DEFAULT)
|
||||
static bool detectMyriadX_()
|
||||
{
|
||||
@@ -1162,6 +1178,12 @@ bool isMyriadX()
|
||||
return myriadX;
|
||||
}
|
||||
|
||||
bool isArmComputePlugin()
|
||||
{
|
||||
static bool armPlugin = getInferenceEngineCPUType() == CV_DNN_INFERENCE_ENGINE_CPU_TYPE_ARM_COMPUTE;
|
||||
return armPlugin;
|
||||
}
|
||||
|
||||
static std::string getInferenceEngineVPUType_()
|
||||
{
|
||||
static std::string param_vpu_type = utils::getConfigurationParameterString("OPENCV_DNN_IE_VPU_TYPE", "");
|
||||
@@ -1199,6 +1221,14 @@ cv::String getInferenceEngineVPUType()
|
||||
return vpu_type;
|
||||
}
|
||||
|
||||
cv::String getInferenceEngineCPUType()
|
||||
{
|
||||
static cv::String cpu_type = detectArmPlugin_() ?
|
||||
CV_DNN_INFERENCE_ENGINE_CPU_TYPE_ARM_COMPUTE :
|
||||
CV_DNN_INFERENCE_ENGINE_CPU_TYPE_X86;
|
||||
return cpu_type;
|
||||
}
|
||||
|
||||
#else // HAVE_INF_ENGINE
|
||||
|
||||
cv::String getInferenceEngineBackendType()
|
||||
@@ -1214,6 +1244,11 @@ cv::String getInferenceEngineVPUType()
|
||||
{
|
||||
CV_Error(Error::StsNotImplemented, "This OpenCV build doesn't include InferenceEngine support");
|
||||
}
|
||||
|
||||
cv::String getInferenceEngineCPUType()
|
||||
{
|
||||
CV_Error(Error::StsNotImplemented, "This OpenCV build doesn't include InferenceEngine support");
|
||||
}
|
||||
#endif // HAVE_INF_ENGINE
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user