aboutsummaryrefslogtreecommitdiff
path: root/tests/NetworkExecutionUtils
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2020-09-15 17:17:08 +0100
committerSadik Armagan <sadik.armagan@arm.com>2020-09-15 16:15:52 +0000
commita25886e0966a6b9433cd23595688fadb88a161b2 (patch)
treef197d2521f7d7120a4d4397a73ca410f83a5d2de /tests/NetworkExecutionUtils
parent6f8699ac6e26f230a734168853c64490d70ac3bc (diff)
downloadarmnn-a25886e0966a6b9433cd23595688fadb88a161b2.tar.gz
IVGCVSW-5317 'Add enable_fast_math Option to ExecuteNetwork'
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I4eb3e27837aea926593d49f9ccea07bab8388d5b
Diffstat (limited to 'tests/NetworkExecutionUtils')
-rw-r--r--tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp
index 74f02d71cb..b5652df37f 100644
--- a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp
+++ b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp
@@ -377,6 +377,7 @@ struct ExecuteNetworkParams
bool m_GenerateTensorData;
bool m_ParseUnsupported = false;
bool m_InferOutputShape = false;
+ bool m_EnableFastMath = false;
};
template<typename TParser, typename TDataType>
@@ -400,6 +401,7 @@ int MainImpl(const ExecuteNetworkParams& params,
inferenceModelParams.m_VisualizePostOptimizationModel = params.m_EnableLayerDetails;
inferenceModelParams.m_ParseUnsupported = params.m_ParseUnsupported;
inferenceModelParams.m_InferOutputShape = params.m_InferOutputShape;
+ inferenceModelParams.m_EnableFastMath = params.m_EnableFastMath;
for(const std::string& inputName: params.m_InputNames)
{
@@ -554,6 +556,7 @@ int RunTest(const std::string& format,
bool enableLayerDetails = false,
bool parseUnsupported = false,
bool inferOutputShape = false,
+ bool enableFastMath = false,
const size_t iterations = 1,
const std::shared_ptr<armnn::IRuntime>& runtime = nullptr)
{
@@ -683,6 +686,7 @@ int RunTest(const std::string& format,
params.m_GenerateTensorData = inputTensorDataFilePathsVector.empty();
params.m_ParseUnsupported = parseUnsupported;
params.m_InferOutputShape = inferOutputShape;
+ params.m_EnableFastMath = enableFastMath;
// Warn if ExecuteNetwork will generate dummy input data
if (params.m_GenerateTensorData)
@@ -754,7 +758,7 @@ int RunTest(const std::string& format,
int RunCsvTest(const armnnUtils::CsvRow &csvRow, const std::shared_ptr<armnn::IRuntime>& runtime,
const bool enableProfiling, const bool enableFp16TurboMode, const bool enableBf16TurboMode,
const double& thresholdTime, const bool printIntermediate, bool enableLayerDetails = false,
- bool parseUnuspported = false, bool inferOutputShape = false)
+ bool parseUnuspported = false, bool inferOutputShape = false, bool enableFastMath = false)
{
IgnoreUnused(runtime);
std::string modelFormat;
@@ -875,7 +879,7 @@ int RunCsvTest(const armnnUtils::CsvRow &csvRow, const std::shared_ptr<armnn::IR
inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames, outputTensorFiles,
dequantizeOutput, enableProfiling, enableFp16TurboMode, enableBf16TurboMode,
thresholdTime, printIntermediate, subgraphId, enableLayerDetails, parseUnuspported,
- inferOutputShape);
+ inferOutputShape, enableFastMath);
}
#if defined(ARMCOMPUTECL_ENABLED)
@@ -902,7 +906,8 @@ int RunCLTuning(const std::string& tuningPath,
const size_t subgraphId,
bool enableLayerDetails = false,
bool parseUnsupported = false,
- bool inferOutputShape = false)
+ bool inferOutputShape = false,
+ bool enableFastMath = false)
{
armnn::IRuntime::CreationOptions options;
options.m_BackendOptions.emplace_back(
@@ -925,7 +930,7 @@ int RunCLTuning(const std::string& tuningPath,
inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames,
outputTensorFiles, dequantizeOutput, enableProfiling, enableFp16TurboMode, enableBf16TurboMode,
thresholdTime, printIntermediate, subgraphId, enableLayerDetails, parseUnsupported,
- inferOutputShape, 1, runtime);
+ inferOutputShape, enableFastMath, 1, runtime);
ARMNN_LOG(info) << "Tuning time: " << std::setprecision(2)
<< std::fixed << armnn::GetTimeDuration(start_time).count() << " ms\n";