diff options
author | Derek Lamberti <derek.lamberti@arm.com> | 2020-03-17 13:40:18 +0000 |
---|---|---|
committer | Derek Lamberti <derek.lamberti@arm.com> | 2020-03-18 00:04:11 +0000 |
commit | 4de83c5a6a57d0468d9f2f854c94bc4a760b66b6 (patch) | |
tree | 090105cdfeba4e56a46f5f06aa6c032caf1db397 /ArmnnPreparedModel.hpp | |
parent | 0b7a419c156e6f9eaf36ec166d4a3e0878b16959 (diff) | |
download | android-nn-driver-4de83c5a6a57d0468d9f2f854c94bc4a760b66b6.tar.gz |
Less code duplication in HAL 1.2
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Change-Id: Ic2e8964745a4323efb1e06d466c0699f17a70c55
Diffstat (limited to 'ArmnnPreparedModel.hpp')
-rw-r--r-- | ArmnnPreparedModel.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ArmnnPreparedModel.hpp b/ArmnnPreparedModel.hpp index 270a9339..89f6226f 100644 --- a/ArmnnPreparedModel.hpp +++ b/ArmnnPreparedModel.hpp @@ -24,6 +24,10 @@ struct ArmnnCallback_1_0 armnnExecuteCallback_1_0 callback; }; +struct ExecutionContext_1_0 {}; + +using CallbackContext_1_0 = CallbackContext<armnnExecuteCallback_1_0, ExecutionContext_1_0>; + template <typename HalVersion> class ArmnnPreparedModel : public V1_0::IPreparedModel { @@ -43,9 +47,9 @@ public: /// execute the graph prepared from the request void ExecuteGraph(std::shared_ptr<std::vector<::android::nn::RunTimePoolInfo>>& pMemPools, - std::shared_ptr<armnn::InputTensors>& pInputTensors, - std::shared_ptr<armnn::OutputTensors>& pOutputTensors, - ArmnnCallback_1_0 callback); + armnn::InputTensors& inputTensors, + armnn::OutputTensors& outputTensors, + CallbackContext_1_0 callback); /// Executes this model with dummy inputs (e.g. all zeroes). /// \return false on failure, otherwise true @@ -60,7 +64,7 @@ private: HalModel m_Model; // There must be a single RequestThread for all ArmnnPreparedModel objects to ensure serial execution of workloads // It is specific to this class, so it is declared as static here - static RequestThread<ArmnnPreparedModel, HalVersion, ArmnnCallback_1_0> m_RequestThread; + static RequestThread<ArmnnPreparedModel, HalVersion, CallbackContext_1_0> m_RequestThread; uint32_t m_RequestCount; const std::string& m_RequestInputsAndOutputsDumpDir; const bool m_GpuProfilingEnabled; |