Takes a vector of backend strings and returns a vector of backendIDs. Removes duplicate entries. Can handle backend strings that contain multiple backends separated by comma e.g "CpuRef,CpuAcc"
| 76 | /// Removes duplicate entries. |
| 77 | /// Can handle backend strings that contain multiple backends separated by comma e.g "CpuRef,CpuAcc" |
| 78 | std::vector<armnn::BackendId> GetBackendIDs(const std::vector<std::string>& backendStringsVec) |
| 79 | { |
| 80 | std::vector<armnn::BackendId> backendIDs; |
| 81 | for (const auto& backendStrings : backendStringsVec) |
| 82 | { |
| 83 | // Each backendStrings might contain multiple backends separated by comma e.g "CpuRef,CpuAcc" |
| 84 | std::vector<std::string> backendStringVec = ParseStringList(backendStrings, ","); |
| 85 | for (const auto& b : backendStringVec) |
| 86 | { |
| 87 | backendIDs.push_back(armnn::BackendId(b)); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | RemoveDuplicateDevices(backendIDs); |
| 92 | |
| 93 | return backendIDs; |
| 94 | } |
| 95 | |
| 96 | /// Provides a segfault safe way to get cxxopts option values by checking if the option was defined. |
| 97 | /// If the option wasn't defined it returns an empty object. |
no test coverage detected