diff options
author | John Mcloughlin <john.mcloughlin@arm.com> | 2023-03-24 12:07:25 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2023-04-12 18:28:23 +0100 |
commit | c5ee0d7460f1e0ec7e2b0639e3e8962934c4df09 (patch) | |
tree | 931f1403589c34fd2de6b94d95e9e172a92424fe /shim | |
parent | ca5c82af9269e7fd7ed17c7df9780a75fdaa733e (diff) | |
download | armnn-c5ee0d7460f1e0ec7e2b0639e3e8962934c4df09.tar.gz |
IVGCVSW-7197 Implement Pimpl Idiom for OptimizerOptions
Signed-off-by: John Mcloughlin <john.mcloughlin@arm.com>
Change-Id: Id4bdc31e3e6f18ccaef232c29a2d2825c915b21c
Diffstat (limited to 'shim')
-rw-r--r-- | shim/sl/canonical/ArmnnDriverImpl.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/shim/sl/canonical/ArmnnDriverImpl.cpp b/shim/sl/canonical/ArmnnDriverImpl.cpp index 0c98a16138..0f7888bb4b 100644 --- a/shim/sl/canonical/ArmnnDriverImpl.cpp +++ b/shim/sl/canonical/ArmnnDriverImpl.cpp @@ -144,9 +144,9 @@ GeneralResult<SharedPreparedModel> ArmnnDriverImpl::PrepareArmnnModel( // Optimize the network armnn::IOptimizedNetworkPtr optNet(nullptr, nullptr); - armnn::OptimizerOptions OptOptions; - OptOptions.m_ReduceFp32ToFp16 = float32ToFloat16; - OptOptions.m_ProfilingEnabled = options.IsGpuProfilingEnabled(); + armnn::OptimizerOptionsOpaque OptOptions; + OptOptions.SetReduceFp32ToFp16(float32ToFloat16); + OptOptions.SetProfilingEnabled(options.IsGpuProfilingEnabled()); int cachedFd = -1; bool saveCachedNetwork = options.SaveCachedNetwork(); @@ -188,8 +188,8 @@ GeneralResult<SharedPreparedModel> ArmnnDriverImpl::PrepareArmnnModel( { "FastMathEnabled", options.IsFastMathEnabled() }, { "NumberOfThreads", options.GetNumberOfThreads() } }); - OptOptions.m_ModelOptions.push_back(gpuAcc); - OptOptions.m_ModelOptions.push_back(cpuAcc); + OptOptions.AddModelOption(gpuAcc); + OptOptions.AddModelOption(cpuAcc); std::vector<std::string> errMessages; try @@ -464,9 +464,9 @@ GeneralResult<SharedPreparedModel> ArmnnDriverImpl::PrepareArmnnModelFromCache( // Optimize the network armnn::IOptimizedNetworkPtr optNet(nullptr, nullptr); - armnn::OptimizerOptions OptOptions; - OptOptions.m_ReduceFp32ToFp16 = float32ToFloat16; - OptOptions.m_ProfilingEnabled = options.IsGpuProfilingEnabled(); + armnn::OptimizerOptionsOpaque OptOptions; + OptOptions.SetReduceFp32ToFp16(float32ToFloat16); + OptOptions.SetProfilingEnabled(options.IsGpuProfilingEnabled()); armnn::BackendOptions gpuAcc("GpuAcc", { @@ -482,8 +482,8 @@ GeneralResult<SharedPreparedModel> ArmnnDriverImpl::PrepareArmnnModelFromCache( { "FastMathEnabled", options.IsFastMathEnabled() }, { "NumberOfThreads", options.GetNumberOfThreads() } }); - OptOptions.m_ModelOptions.push_back(gpuAcc); - OptOptions.m_ModelOptions.push_back(cpuAcc); + OptOptions.AddModelOption(gpuAcc); + OptOptions.AddModelOption(cpuAcc); std::vector<std::string> errMessages; try |