diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2018-09-03 13:50:50 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-09-18 12:40:38 +0100 |
commit | e48bdff741568236d3c0747ad3d18a8eba5b36dd (patch) | |
tree | 77aabce6f75d86d3f2f3924f342292ae5a7267e7 /RequestThread.hpp | |
parent | a15dc11fd7bf3ad49e752ec75157b731287fe46d (diff) | |
download | android-nn-driver-e48bdff741568236d3c0747ad3d18a8eba5b36dd.tar.gz |
IVGCVSW-1806 Refactored Android-NN-Driver, added common "getCapabilities",
"getSupportedOperations" and "prepareModel" implementations
* Added common base ArmnnDriverImpl class
* Added common template implementation of the driver's "getCapabilities",
"getSupportedOperations" and "prepareModel" methods
* Refactored ArmnnPreparedModel and RequestThread to support HAL
v1.1 models
* Moved "getStatus" to the common base class, as it is shared by both
HAL implementations
* Refactored the code where necessary
Change-Id: I747334730026d63b4002662523fb93608f67c899
Diffstat (limited to 'RequestThread.hpp')
-rw-r--r-- | RequestThread.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/RequestThread.hpp b/RequestThread.hpp index 2448dbec..41ad213b 100644 --- a/RequestThread.hpp +++ b/RequestThread.hpp @@ -11,6 +11,7 @@ #include <condition_variable> #include "ArmnnDriver.hpp" +#include "ArmnnDriverImpl.hpp" #include <CpuExecutor.h> #include <armnn/ArmNN.hpp> @@ -18,8 +19,10 @@ namespace armnn_driver { +template<typename HalVersion> class ArmnnPreparedModel; +template<typename HalVersion> class RequestThread { public: @@ -35,7 +38,7 @@ public: /// @param[in] inputTensors pointer to the input tensors for the request /// @param[in] outputTensors pointer to the output tensors for the request /// @param[in] callback the android notification callback - void PostMsg(armnn_driver::ArmnnPreparedModel* model, + void PostMsg(armnn_driver::ArmnnPreparedModel<HalVersion>* model, std::shared_ptr<std::vector<::android::nn::RunTimePoolInfo>>& memPools, std::shared_ptr<armnn::InputTensors>& inputTensors, std::shared_ptr<armnn::OutputTensors>& outputTensors, @@ -48,7 +51,7 @@ private: /// storage for a prepared model and args for the asyncExecute call struct AsyncExecuteData { - AsyncExecuteData(ArmnnPreparedModel* model, + AsyncExecuteData(ArmnnPreparedModel<HalVersion>* model, std::shared_ptr<std::vector<::android::nn::RunTimePoolInfo>>& memPools, std::shared_ptr<armnn::InputTensors>& inputTensors, std::shared_ptr<armnn::OutputTensors>& outputTensors, @@ -61,7 +64,7 @@ private: { } - armnn_driver::ArmnnPreparedModel* m_Model; + armnn_driver::ArmnnPreparedModel<HalVersion>* m_Model; std::shared_ptr<std::vector<::android::nn::RunTimePoolInfo>> m_MemPools; std::shared_ptr<armnn::InputTensors> m_InputTensors; std::shared_ptr<armnn::OutputTensors> m_OutputTensors; |