| 1947 | } |
| 1948 | |
| 1949 | bool CheckFastMathSupport(const std::vector<BackendId>& availablePreferredBackends, |
| 1950 | const ModelOptions& modelOptions) |
| 1951 | { |
| 1952 | bool hasFastMath = false; |
| 1953 | // Check if the first preferred backend has Fastmath support |
| 1954 | auto firstBackend = availablePreferredBackends[0]; |
| 1955 | if (!modelOptions.empty()) |
| 1956 | { |
| 1957 | ParseOptions(modelOptions, firstBackend, [&](std::string name, const BackendOptions::Var& value) |
| 1958 | { |
| 1959 | if (name == "FastMathEnabled") |
| 1960 | { |
| 1961 | hasFastMath = value.AsBool(); |
| 1962 | ARMNN_LOG(debug) << "The first available preferred backend: " << firstBackend |
| 1963 | << ", has FastMath support."; |
| 1964 | } |
| 1965 | }); |
| 1966 | } |
| 1967 | else |
| 1968 | { |
| 1969 | ARMNN_LOG(warning) << "The first available preferred backend: " << firstBackend |
| 1970 | << ", does not have FastMath support. " |
| 1971 | << "Support for Turbo mode for TfLite post quantized FP16 models wil be disabled."; |
| 1972 | } |
| 1973 | |
| 1974 | return hasFastMath; |
| 1975 | } |
| 1976 | |
| 1977 | bool IsTfLiteTurboModel(const Graph& optGraph) |
| 1978 | { |
no test coverage detected