diff options
author | Mike Kelly <mike.kelly@arm.com> | 2020-09-30 20:22:56 +0100 |
---|---|---|
committer | mike.kelly <mike.kelly@arm.com> | 2020-09-30 19:41:56 +0000 |
commit | 7ed56dd5808d483ab8e294f36e3ecf8e8ddd84f1 (patch) | |
tree | b53d5499204280f539e17e7f66d0d4e7790863c2 /1.2/ArmnnDriverImpl.cpp | |
parent | 9b088d9c275ed11ca39f8b035e02a68f681c5d45 (diff) | |
download | android-nn-driver-7ed56dd5808d483ab8e294f36e3ecf8e8ddd84f1.tar.gz |
MLCE-233 Added ability to enable fast_math through the NNAPI driver
* Added -a command line option to enable fast_math on Neon/CL when launching the NNAPI driver
* The invocation will look something like:
/vendor/bin/hw/android.hardware.neuralnetworks@1.3-service-armnn -v -c GpuAcc -n arm-armnn -a
* Enabling fast_math may cause an increase in VTS or CTS test failures due to a change in precision
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: Ifd8931f95efd65d3ae3aca9d9d61bd381e4e24a5
Diffstat (limited to '1.2/ArmnnDriverImpl.cpp')
-rw-r--r-- | 1.2/ArmnnDriverImpl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/1.2/ArmnnDriverImpl.cpp b/1.2/ArmnnDriverImpl.cpp index 4571fe0e..6d713e06 100644 --- a/1.2/ArmnnDriverImpl.cpp +++ b/1.2/ArmnnDriverImpl.cpp @@ -130,6 +130,17 @@ Return<V1_0::ErrorStatus> ArmnnDriverImpl::prepareArmnnModel_1_2( armnn::OptimizerOptions OptOptions; OptOptions.m_ReduceFp32ToFp16 = float32ToFloat16; + armnn::BackendOptions gpuAcc("GpuAcc", + { + { "FastMathEnabled", options.IsFastMathEnabled() } + }); + armnn::BackendOptions cpuAcc("CpuAcc", + { + { "FastMathEnabled", options.IsFastMathEnabled() } + }); + OptOptions.m_ModelOptions.push_back(gpuAcc); + OptOptions.m_ModelOptions.push_back(cpuAcc); + std::vector<std::string> errMessages; try { |