telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | 93e4898 | 2018-09-05 13:05:09 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #define LOG_TAG "ArmnnDriver" |
| 7 | |
| 8 | #include "ArmnnPreparedModel.hpp" |
| 9 | #include "Utils.hpp" |
| 10 | |
| 11 | #include <boost/format.hpp> |
| 12 | #include <log/log.h> |
| 13 | #include <OperationsUtils.h> |
| 14 | |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 15 | #if defined(ARMNN_ANDROID_P) || defined(ARMNN_ANDROID_Q) |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 16 | // The headers of the ML framework have changed between Android O and Android P. |
| 17 | // The validation functions have been moved into their own header, ValidateHal.h. |
| 18 | #include <ValidateHal.h> |
| 19 | #endif |
| 20 | |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 21 | #include <cassert> |
| 22 | #include <cinttypes> |
| 23 | |
| 24 | using namespace android; |
| 25 | |
| 26 | namespace |
| 27 | { |
| 28 | using namespace armnn_driver; |
| 29 | |
Matthew Bentham | 9e80cd2 | 2019-05-03 22:54:36 +0100 | [diff] [blame] | 30 | void NotifyCallbackAndCheck(const ::android::sp<V1_0::IExecutionCallback>& callback, ErrorStatus errorStatus, |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 31 | std::string callingFunction) |
| 32 | { |
| 33 | Return<void> returned = callback->notify(errorStatus); |
| 34 | // This check is required, if the callback fails and it isn't checked it will bring down the service |
| 35 | if (!returned.isOk()) |
| 36 | { |
| 37 | ALOGE("ArmnnDriver::%s: hidl callback failed to return properly: %s", |
| 38 | callingFunction.c_str(), returned.description().c_str()); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | bool ValidateRequestArgument(const RequestArgument& requestArg, const armnn::TensorInfo& tensorInfo) |
| 43 | { |
| 44 | if (requestArg.dimensions.size() != 0) |
| 45 | { |
| 46 | if (requestArg.dimensions.size() != tensorInfo.GetNumDimensions()) |
| 47 | { |
| 48 | ALOGE("Mismatched dimensions (request argument: %zu, expected: %u)", |
| 49 | requestArg.dimensions.size(), tensorInfo.GetNumDimensions()); |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | for (unsigned int d = 0; d < tensorInfo.GetNumDimensions(); ++d) |
| 54 | { |
| 55 | if (requestArg.dimensions[d] != tensorInfo.GetShape()[d]) |
| 56 | { |
| 57 | ALOGE("Mismatched size for dimension %d (request argument: %u, expected %u)", |
| 58 | d, requestArg.dimensions[d], tensorInfo.GetShape()[d]); |
| 59 | return false; |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | armnn::Tensor GetTensorForRequestArgument(const RequestArgument& requestArg, |
| 68 | const armnn::TensorInfo& tensorInfo, |
| 69 | const std::vector<::android::nn::RunTimePoolInfo>& requestPools) |
| 70 | { |
| 71 | if (!ValidateRequestArgument(requestArg, tensorInfo)) |
| 72 | { |
| 73 | return armnn::Tensor(); |
| 74 | } |
| 75 | |
| 76 | return armnn::Tensor(tensorInfo, GetMemoryFromPool(requestArg.location, requestPools)); |
| 77 | } |
| 78 | |
| 79 | inline std::string BuildTensorName(const char* tensorNamePrefix, std::size_t index) |
| 80 | { |
| 81 | return tensorNamePrefix + std::to_string(index); |
| 82 | } |
| 83 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 84 | } // anonymous namespace |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 85 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 86 | using namespace android::hardware; |
| 87 | |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 88 | namespace armnn_driver |
| 89 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 90 | template<typename HalVersion> |
Mike Kelly | 65c42dc | 2019-07-22 14:06:00 +0100 | [diff] [blame] | 91 | RequestThread<ArmnnPreparedModel, HalVersion, ArmnnCallback_1_0> ArmnnPreparedModel<HalVersion>::m_RequestThread; |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 92 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 93 | template<typename HalVersion> |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 94 | template <typename TensorBindingCollection> |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 95 | void ArmnnPreparedModel<HalVersion>::DumpTensorsIfRequired(char const* tensorNamePrefix, |
| 96 | const TensorBindingCollection& tensorBindings) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 97 | { |
| 98 | if (!m_RequestInputsAndOutputsDumpDir.empty()) |
| 99 | { |
| 100 | const std::string requestName = boost::str(boost::format("%1%_%2%.dump") % m_NetworkId % m_RequestCount); |
| 101 | for (std::size_t i = 0u; i < tensorBindings.size(); ++i) |
| 102 | { |
| 103 | DumpTensor(m_RequestInputsAndOutputsDumpDir, |
| 104 | requestName, |
| 105 | BuildTensorName(tensorNamePrefix, i), |
| 106 | tensorBindings[i].second); |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 111 | template<typename HalVersion> |
| 112 | ArmnnPreparedModel<HalVersion>::ArmnnPreparedModel(armnn::NetworkId networkId, |
| 113 | armnn::IRuntime* runtime, |
| 114 | const HalModel& model, |
| 115 | const std::string& requestInputsAndOutputsDumpDir, |
| 116 | const bool gpuProfilingEnabled) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 117 | : m_NetworkId(networkId) |
| 118 | , m_Runtime(runtime) |
| 119 | , m_Model(model) |
| 120 | , m_RequestCount(0) |
| 121 | , m_RequestInputsAndOutputsDumpDir(requestInputsAndOutputsDumpDir) |
| 122 | , m_GpuProfilingEnabled(gpuProfilingEnabled) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 123 | { |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 124 | // Enable profiling if required. |
| 125 | m_Runtime->GetProfiler(m_NetworkId)->EnableProfiling(m_GpuProfilingEnabled); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 126 | } |
| 127 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 128 | template<typename HalVersion> |
| 129 | ArmnnPreparedModel<HalVersion>::~ArmnnPreparedModel() |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 130 | { |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 131 | // Get a hold of the profiler used by this model. |
| 132 | std::shared_ptr<armnn::IProfiler> profiler = m_Runtime->GetProfiler(m_NetworkId); |
| 133 | |
| 134 | // Unload the network associated with this model. |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 135 | m_Runtime->UnloadNetwork(m_NetworkId); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 136 | |
| 137 | // Dump the profiling info to a file if required. |
| 138 | DumpJsonProfilingIfRequired(m_GpuProfilingEnabled, m_RequestInputsAndOutputsDumpDir, m_NetworkId, profiler.get()); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 139 | } |
| 140 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 141 | template<typename HalVersion> |
| 142 | Return<ErrorStatus> ArmnnPreparedModel<HalVersion>::execute(const Request& request, |
Matthew Bentham | 9e80cd2 | 2019-05-03 22:54:36 +0100 | [diff] [blame] | 143 | const ::android::sp<V1_0::IExecutionCallback>& callback) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 144 | { |
| 145 | ALOGV("ArmnnPreparedModel::execute(): %s", GetModelSummary(m_Model).c_str()); |
| 146 | m_RequestCount++; |
| 147 | |
| 148 | if (callback.get() == nullptr) { |
| 149 | ALOGE("ArmnnPreparedModel::execute invalid callback passed"); |
| 150 | return ErrorStatus::INVALID_ARGUMENT; |
| 151 | } |
| 152 | |
| 153 | if (!android::nn::validateRequest(request, m_Model)) |
| 154 | { |
| 155 | NotifyCallbackAndCheck(callback, ErrorStatus::INVALID_ARGUMENT, "ArmnnPreparedModel::execute"); |
| 156 | return ErrorStatus::INVALID_ARGUMENT; |
| 157 | } |
| 158 | |
| 159 | if (!m_RequestInputsAndOutputsDumpDir.empty()) |
| 160 | { |
| 161 | ALOGD("Dumping inputs and outputs for request %" PRIuPTR, reinterpret_cast<std::uintptr_t>(callback.get())); |
| 162 | } |
| 163 | |
| 164 | // allocate the tensors on the heap, as they are passed to the request thread |
| 165 | auto pInputTensors = std::make_shared<armnn::InputTensors>(); |
| 166 | auto pOutputTensors = std::make_shared<armnn::OutputTensors>(); |
| 167 | |
| 168 | // map the memory pool into shared pointers |
| 169 | // use a shared memory pools vector on the heap, as it is passed to the request thread |
| 170 | auto pMemPools = std::make_shared<std::vector<android::nn::RunTimePoolInfo>>(); |
| 171 | if (!setRunTimePoolInfosFromHidlMemories(pMemPools.get(), request.pools)) |
| 172 | { |
| 173 | NotifyCallbackAndCheck(callback, ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::execute"); |
| 174 | return ErrorStatus::GENERAL_FAILURE; |
| 175 | } |
| 176 | |
| 177 | // add the inputs and outputs with their data |
| 178 | try |
| 179 | { |
| 180 | pInputTensors->reserve(request.inputs.size()); |
| 181 | for (unsigned int i = 0; i < request.inputs.size(); i++) |
| 182 | { |
| 183 | const auto& inputArg = request.inputs[i]; |
| 184 | |
| 185 | const armnn::TensorInfo inputTensorInfo = m_Runtime->GetInputTensorInfo(m_NetworkId, i); |
| 186 | const armnn::Tensor inputTensor = GetTensorForRequestArgument(inputArg, inputTensorInfo, *pMemPools); |
| 187 | if (inputTensor.GetMemoryArea() == nullptr) |
| 188 | { |
| 189 | ALOGE("Cannot execute request. Error converting request input %u to tensor", i); |
| 190 | return ErrorStatus::GENERAL_FAILURE; |
| 191 | } |
| 192 | |
| 193 | pInputTensors->emplace_back(i, inputTensor); |
| 194 | } |
| 195 | |
| 196 | pOutputTensors->reserve(request.outputs.size()); |
| 197 | for (unsigned int i = 0; i < request.outputs.size(); i++) |
| 198 | { |
| 199 | const auto& outputArg = request.outputs[i]; |
| 200 | |
| 201 | const armnn::TensorInfo outputTensorInfo = m_Runtime->GetOutputTensorInfo(m_NetworkId, i); |
| 202 | const armnn::Tensor outputTensor = GetTensorForRequestArgument(outputArg, outputTensorInfo, *pMemPools); |
| 203 | if (outputTensor.GetMemoryArea() == nullptr) |
| 204 | { |
| 205 | ALOGE("Cannot execute request. Error converting request output %u to tensor", i); |
| 206 | return ErrorStatus::GENERAL_FAILURE; |
| 207 | } |
| 208 | |
| 209 | pOutputTensors->emplace_back(i, outputTensor); |
| 210 | } |
| 211 | } |
Kevin May | 7bdaac5 | 2020-02-10 12:10:07 +0000 | [diff] [blame] | 212 | catch (armnn::Exception& e) |
| 213 | { |
| 214 | ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what()); |
| 215 | NotifyCallbackAndCheck(callback, ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::execute"); |
| 216 | return ErrorStatus::GENERAL_FAILURE; |
| 217 | } |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 218 | catch (std::exception& e) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 219 | { |
Kevin May | 7bdaac5 | 2020-02-10 12:10:07 +0000 | [diff] [blame] | 220 | ALOGE("std::exception caught while preparing for EnqueueWorkload: %s", e.what()); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 221 | NotifyCallbackAndCheck(callback, ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::execute"); |
| 222 | return ErrorStatus::GENERAL_FAILURE; |
| 223 | } |
| 224 | |
| 225 | ALOGV("ArmnnPreparedModel::execute(...) before PostMsg"); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 226 | |
Mike Kelly | 65c42dc | 2019-07-22 14:06:00 +0100 | [diff] [blame] | 227 | auto cb = [callback](ErrorStatus errorStatus, std::string callingFunction) |
| 228 | { |
| 229 | NotifyCallbackAndCheck(callback, errorStatus, callingFunction); |
| 230 | }; |
| 231 | |
| 232 | ArmnnCallback_1_0 armnnCb; |
| 233 | armnnCb.callback = cb; |
| 234 | // post the request for asynchronous execution |
| 235 | m_RequestThread.PostMsg(this, pMemPools, pInputTensors, pOutputTensors, armnnCb); |
| 236 | ALOGV("ArmnnPreparedModel::execute(...) after PostMsg"); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 237 | return ErrorStatus::NONE; // successfully queued |
| 238 | } |
| 239 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 240 | template<typename HalVersion> |
| 241 | void ArmnnPreparedModel<HalVersion>::ExecuteGraph( |
| 242 | std::shared_ptr<std::vector<::android::nn::RunTimePoolInfo>>& pMemPools, |
| 243 | std::shared_ptr<armnn::InputTensors>& pInputTensors, |
| 244 | std::shared_ptr<armnn::OutputTensors>& pOutputTensors, |
Mike Kelly | 65c42dc | 2019-07-22 14:06:00 +0100 | [diff] [blame] | 245 | ArmnnCallback_1_0 cb) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 246 | { |
| 247 | ALOGV("ArmnnPreparedModel::ExecuteGraph(...)"); |
| 248 | |
| 249 | DumpTensorsIfRequired("Input", *pInputTensors); |
| 250 | |
| 251 | // run it |
| 252 | try |
| 253 | { |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 254 | armnn::Status status = m_Runtime->EnqueueWorkload(m_NetworkId, *pInputTensors, *pOutputTensors); |
| 255 | if (status != armnn::Status::Success) |
| 256 | { |
| 257 | ALOGW("EnqueueWorkload failed"); |
Mike Kelly | 65c42dc | 2019-07-22 14:06:00 +0100 | [diff] [blame] | 258 | cb.callback(ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::ExecuteGraph"); |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 259 | return; |
| 260 | } |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 261 | } |
Kevin May | 7bdaac5 | 2020-02-10 12:10:07 +0000 | [diff] [blame] | 262 | catch (armnn::Exception& e) |
| 263 | { |
| 264 | ALOGW("armnn::Exception caught from EnqueueWorkload: %s", e.what()); |
| 265 | cb.callback(ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::ExecuteGraph"); |
| 266 | return; |
| 267 | } |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 268 | catch (std::exception& e) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 269 | { |
Kevin May | 7bdaac5 | 2020-02-10 12:10:07 +0000 | [diff] [blame] | 270 | ALOGE("std::exception caught from EnqueueWorkload: %s", e.what()); |
Mike Kelly | 65c42dc | 2019-07-22 14:06:00 +0100 | [diff] [blame] | 271 | cb.callback(ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::ExecuteGraph"); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 272 | return; |
| 273 | } |
| 274 | |
| 275 | DumpTensorsIfRequired("Output", *pOutputTensors); |
| 276 | |
| 277 | // Commit output buffers. |
| 278 | // Note that we update *all* pools, even if they aren't actually used as outputs - |
| 279 | // this is simpler and is what the CpuExecutor does. |
| 280 | for (android::nn::RunTimePoolInfo& pool : *pMemPools) |
| 281 | { |
| 282 | pool.update(); |
| 283 | } |
| 284 | |
Mike Kelly | 65c42dc | 2019-07-22 14:06:00 +0100 | [diff] [blame] | 285 | cb.callback(ErrorStatus::NONE, "ExecuteGraph"); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 286 | } |
| 287 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 288 | template<typename HalVersion> |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 289 | bool ArmnnPreparedModel<HalVersion>::ExecuteWithDummyInputs() |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 290 | { |
| 291 | std::vector<std::vector<char>> storage; |
| 292 | armnn::InputTensors inputTensors; |
| 293 | for (unsigned int i = 0; i < m_Model.inputIndexes.size(); i++) |
| 294 | { |
| 295 | const armnn::TensorInfo inputTensorInfo = m_Runtime->GetInputTensorInfo(m_NetworkId, i); |
| 296 | storage.emplace_back(inputTensorInfo.GetNumBytes()); |
| 297 | const armnn::ConstTensor inputTensor(inputTensorInfo, storage.back().data()); |
| 298 | |
| 299 | inputTensors.emplace_back(i, inputTensor); |
| 300 | } |
| 301 | |
| 302 | armnn::OutputTensors outputTensors; |
| 303 | for (unsigned int i = 0; i < m_Model.outputIndexes.size(); i++) |
| 304 | { |
| 305 | const armnn::TensorInfo outputTensorInfo = m_Runtime->GetOutputTensorInfo(m_NetworkId, i); |
| 306 | storage.emplace_back(outputTensorInfo.GetNumBytes()); |
| 307 | const armnn::Tensor outputTensor(outputTensorInfo, storage.back().data()); |
| 308 | |
| 309 | outputTensors.emplace_back(i, outputTensor); |
| 310 | } |
| 311 | |
| 312 | try |
| 313 | { |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 314 | armnn::Status status = m_Runtime->EnqueueWorkload(m_NetworkId, inputTensors, outputTensors); |
| 315 | if (status != armnn::Status::Success) |
| 316 | { |
| 317 | ALOGW("ExecuteWithDummyInputs: EnqueueWorkload failed"); |
| 318 | return false; |
| 319 | } |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 320 | } |
Kevin May | 7bdaac5 | 2020-02-10 12:10:07 +0000 | [diff] [blame] | 321 | catch (armnn::Exception& e) |
| 322 | { |
| 323 | ALOGW("ExecuteWithDummyInputs: armnn::Exception caught from EnqueueWorkload: %s", e.what()); |
| 324 | return false; |
| 325 | } |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 326 | catch (std::exception& e) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 327 | { |
Kevin May | 7bdaac5 | 2020-02-10 12:10:07 +0000 | [diff] [blame] | 328 | ALOGE("ExecuteWithDummyInputs: std::exception caught from EnqueueWorkload: %s", e.what()); |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 329 | return false; |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 330 | } |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 331 | return true; |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 332 | } |
| 333 | |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 334 | /// |
| 335 | /// Class template specializations |
| 336 | /// |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 337 | |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 338 | template class ArmnnPreparedModel<hal_1_0::HalPolicy>; |
| 339 | |
Matteo Martincigh | 8b287c2 | 2018-09-07 09:25:10 +0100 | [diff] [blame] | 340 | #ifdef ARMNN_ANDROID_NN_V1_1 |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 341 | template class ArmnnPreparedModel<hal_1_1::HalPolicy>; |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 342 | #endif |
| 343 | |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 344 | #ifdef ARMNN_ANDROID_NN_V1_2 |
| 345 | template class ArmnnPreparedModel<hal_1_1::HalPolicy>; |
| 346 | template class ArmnnPreparedModel<hal_1_2::HalPolicy>; |
| 347 | #endif |
Nikhil Raj | 7760582 | 2018-09-03 11:25:56 +0100 | [diff] [blame] | 348 | } // namespace armnn_driver |