1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

dnn: split dnn.cpp code

base commit: 19926e2979
original dnn.cpp content: https://github.com/opencv/opencv/blame/19926e2979ef049a89dd029e2231555db40c2776/modules/dnn/src/dnn.cpp
This commit is contained in:
Alexander Alekhin
2022-02-16 21:55:56 +00:00
parent 119d8b3aca
commit a80af177b6
27 changed files with 6749 additions and 5858 deletions
+25
View File
@@ -254,6 +254,31 @@ cv::String getInferenceEngineCPUType()
return cpu_type;
}
namespace openvino {
bool checkTarget(Target target)
{
// Lightweight detection
const std::vector<std::string> devices = getCore("").GetAvailableDevices();
for (std::vector<std::string>::const_iterator i = devices.begin(); i != devices.end(); ++i)
{
if (std::string::npos != i->find("MYRIAD") && target == DNN_TARGET_MYRIAD)
return true;
if (std::string::npos != i->find("HDDL") && target == DNN_TARGET_HDDL)
return true;
else if (std::string::npos != i->find("FPGA") && target == DNN_TARGET_FPGA)
return true;
else if (std::string::npos != i->find("CPU") && target == DNN_TARGET_CPU)
return true;
else if (std::string::npos != i->find("GPU") && (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16))
return true;
}
return false;
}
} // namespace openvino
#else // HAVE_INF_ENGINE
cv::String getInferenceEngineBackendType()