| 12 | #include <armnnUtils/Filesystem.hpp> |
| 13 | |
| 14 | void CheckClTuningParameter(const int& tuningLevel, |
| 15 | const std::string& tuningPath, |
| 16 | const std::vector<armnn::BackendId> computeDevices) |
| 17 | { |
| 18 | if (!tuningPath.empty()) |
| 19 | { |
| 20 | if (tuningLevel == 0) |
| 21 | { |
| 22 | ARMNN_LOG(info) << "Using cl tuning file: " << tuningPath << "\n"; |
| 23 | if (!ValidatePath(tuningPath, true)) |
| 24 | { |
| 25 | throw armnn::InvalidArgumentException("The tuning path is not valid"); |
| 26 | } |
| 27 | } |
| 28 | else if ((1 <= tuningLevel) && (tuningLevel <= 3)) |
| 29 | { |
| 30 | ARMNN_LOG(info) << "Starting execution to generate a cl tuning file: " << tuningPath << "\n" |
| 31 | << "Tuning level in use: " << tuningLevel << "\n"; |
| 32 | } |
| 33 | else if ((0 < tuningLevel) || (tuningLevel > 3)) |
| 34 | { |
| 35 | throw armnn::InvalidArgumentException(fmt::format("The tuning level {} is not valid.", |
| 36 | tuningLevel)); |
| 37 | } |
| 38 | |
| 39 | // Ensure that a GpuAcc is enabled. Otherwise no tuning data are used or genereted |
| 40 | // Only warn if it's not enabled |
| 41 | auto it = std::find(computeDevices.begin(), computeDevices.end(), "GpuAcc"); |
| 42 | if (it == computeDevices.end()) |
| 43 | { |
| 44 | ARMNN_LOG(warning) << "To use Cl Tuning the compute device GpuAcc needs to be active."; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | void ExecuteNetworkParams::ValidateParams() |
| 50 | { |
no test coverage detected