MCPcopy Create free account
hub / github.com/ARM-software/armnn / CheckFastMathSupport

Function CheckFastMathSupport

src/armnn/Network.cpp:1949–1975  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1947}
1948
1949bool 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
1977bool IsTfLiteTurboModel(const Graph& optGraph)
1978{

Callers 1

OptimizeFunction · 0.85

Calls 3

emptyMethod · 0.80
AsBoolMethod · 0.80
ParseOptionsFunction · 0.50

Tested by

no test coverage detected