telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [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 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 4 | // |
| 5 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 6 | #define LOG_TAG "ArmnnDriver" |
| 7 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 8 | #include "ArmnnDriverImpl.hpp" |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 9 | #include "ArmnnPreparedModel.hpp" |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 10 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 11 | #if defined(ARMNN_ANDROID_NN_V1_2) || defined(ARMNN_ANDROID_NN_V1_3) // Using ::android::hardware::neuralnetworks::V1_2 |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 12 | #include "ArmnnPreparedModel_1_2.hpp" |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 13 | #endif |
| 14 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 15 | #ifdef ARMNN_ANDROID_NN_V1_3 // Using ::android::hardware::neuralnetworks::V1_2 |
| 16 | #include "ArmnnPreparedModel_1_3.hpp" |
| 17 | #endif |
| 18 | |
| 19 | #include "Utils.hpp" |
| 20 | |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 21 | #include "ModelToINetworkConverter.hpp" |
| 22 | #include "SystemPropertiesUtils.hpp" |
| 23 | #include <ValidateHal.h> |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 24 | #include <log/log.h> |
| 25 | |
| 26 | using namespace std; |
| 27 | using namespace android; |
| 28 | using namespace android::nn; |
| 29 | using namespace android::hardware; |
| 30 | |
| 31 | namespace |
| 32 | { |
| 33 | |
Matthew Bentham | 912b362 | 2019-05-03 15:49:14 +0100 | [diff] [blame] | 34 | void NotifyCallbackAndCheck(const sp<V1_0::IPreparedModelCallback>& callback, |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 35 | V1_0::ErrorStatus errorStatus, |
Matthew Bentham | 912b362 | 2019-05-03 15:49:14 +0100 | [diff] [blame] | 36 | const sp<V1_0::IPreparedModel>& preparedModelPtr) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 37 | { |
| 38 | Return<void> returned = callback->notify(errorStatus, preparedModelPtr); |
| 39 | // This check is required, if the callback fails and it isn't checked it will bring down the service |
| 40 | if (!returned.isOk()) |
| 41 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 42 | ALOGE("ArmnnDriverImpl::prepareModel: hidl callback failed to return properly: %s ", |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 43 | returned.description().c_str()); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 44 | } |
| 45 | } |
| 46 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 47 | Return<V1_0::ErrorStatus> FailPrepareModel(V1_0::ErrorStatus error, |
| 48 | const string& message, |
| 49 | const sp<V1_0::IPreparedModelCallback>& callback) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 50 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 51 | ALOGW("ArmnnDriverImpl::prepareModel: %s", message.c_str()); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 52 | NotifyCallbackAndCheck(callback, error, nullptr); |
| 53 | return error; |
| 54 | } |
| 55 | |
| 56 | } // namespace |
| 57 | |
| 58 | namespace armnn_driver |
| 59 | { |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 60 | |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 61 | template<typename HalPolicy> |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 62 | Return<V1_0::ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel( |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 63 | const armnn::IRuntimePtr& runtime, |
| 64 | const armnn::IGpuAccTunedParametersPtr& clTunedParameters, |
| 65 | const DriverOptions& options, |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 66 | const HalModel& model, |
Matthew Bentham | 912b362 | 2019-05-03 15:49:14 +0100 | [diff] [blame] | 67 | const sp<V1_0::IPreparedModelCallback>& cb, |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 68 | bool float32ToFloat16) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 69 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 70 | ALOGV("ArmnnDriverImpl::prepareModel()"); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 71 | |
| 72 | if (cb.get() == nullptr) |
| 73 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 74 | ALOGW("ArmnnDriverImpl::prepareModel: Invalid callback passed to prepareModel"); |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 75 | return V1_0::ErrorStatus::INVALID_ARGUMENT; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | if (!runtime) |
| 79 | { |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 80 | return FailPrepareModel(V1_0::ErrorStatus::DEVICE_UNAVAILABLE, "Device unavailable", cb); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | if (!android::nn::validateModel(model)) |
| 84 | { |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 85 | return FailPrepareModel(V1_0::ErrorStatus::INVALID_ARGUMENT, "Invalid model passed as input", cb); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | // Deliberately ignore any unsupported operations requested by the options - |
| 89 | // at this point we're being asked to prepare a model that we've already declared support for |
| 90 | // and the operation indices may be different to those in getSupportedOperations anyway. |
| 91 | set<unsigned int> unsupportedOperations; |
Nattapat Chaimanowong | d5fd976 | 2019-04-04 13:33:10 +0100 | [diff] [blame] | 92 | ModelToINetworkConverter<HalPolicy> modelConverter(options.GetBackends(), |
| 93 | model, |
| 94 | unsupportedOperations); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 95 | |
| 96 | if (modelConverter.GetConversionResult() != ConversionResult::Success) |
| 97 | { |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 98 | FailPrepareModel(V1_0::ErrorStatus::GENERAL_FAILURE, "ModelToINetworkConverter failed", cb); |
| 99 | return V1_0::ErrorStatus::NONE; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 100 | } |
| 101 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 102 | // Optimize the network |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 103 | armnn::IOptimizedNetworkPtr optNet(nullptr, nullptr); |
| 104 | armnn::OptimizerOptions OptOptions; |
| 105 | OptOptions.m_ReduceFp32ToFp16 = float32ToFloat16; |
| 106 | |
Mike Kelly | 7ed56dd | 2020-09-30 20:22:56 +0100 | [diff] [blame] | 107 | armnn::BackendOptions gpuAcc("GpuAcc", |
| 108 | { |
| 109 | { "FastMathEnabled", options.IsFastMathEnabled() } |
| 110 | }); |
| 111 | armnn::BackendOptions cpuAcc("CpuAcc", |
| 112 | { |
| 113 | { "FastMathEnabled", options.IsFastMathEnabled() } |
| 114 | }); |
| 115 | OptOptions.m_ModelOptions.push_back(gpuAcc); |
| 116 | OptOptions.m_ModelOptions.push_back(cpuAcc); |
| 117 | |
jimfly01 | 07dedda | 2018-10-09 12:29:41 +0100 | [diff] [blame] | 118 | std::vector<std::string> errMessages; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 119 | try |
| 120 | { |
| 121 | optNet = armnn::Optimize(*modelConverter.GetINetwork(), |
Nattapat Chaimanowong | d5fd976 | 2019-04-04 13:33:10 +0100 | [diff] [blame] | 122 | options.GetBackends(), |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 123 | runtime->GetDeviceSpec(), |
jimfly01 | 07dedda | 2018-10-09 12:29:41 +0100 | [diff] [blame] | 124 | OptOptions, |
| 125 | errMessages); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 126 | } |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 127 | catch (std::exception &e) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 128 | { |
| 129 | stringstream message; |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 130 | message << "Exception (" << e.what() << ") caught from optimize."; |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 131 | FailPrepareModel(V1_0::ErrorStatus::GENERAL_FAILURE, message.str(), cb); |
| 132 | return V1_0::ErrorStatus::NONE; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | // Check that the optimized network is valid. |
| 136 | if (!optNet) |
| 137 | { |
jimfly01 | 07dedda | 2018-10-09 12:29:41 +0100 | [diff] [blame] | 138 | stringstream message; |
Matteo Martincigh | 8d50f8f | 2018-10-25 15:39:33 +0100 | [diff] [blame] | 139 | message << "Invalid optimized network"; |
| 140 | for (const string& msg : errMessages) |
| 141 | { |
jimfly01 | 07dedda | 2018-10-09 12:29:41 +0100 | [diff] [blame] | 142 | message << "\n" << msg; |
| 143 | } |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 144 | FailPrepareModel(V1_0::ErrorStatus::GENERAL_FAILURE, message.str(), cb); |
| 145 | return V1_0::ErrorStatus::NONE; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | // Export the optimized network graph to a dot file if an output dump directory |
| 149 | // has been specified in the drivers' arguments. |
Jim Flynn | 829ad30 | 2019-12-13 14:43:24 +0000 | [diff] [blame] | 150 | std::string dotGraphFileName = ExportNetworkGraphToDotFile(*optNet, options.GetRequestInputsAndOutputsDumpDir()); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 151 | |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 152 | // Load it into the runtime. |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 153 | armnn::NetworkId netId = 0; |
| 154 | try |
| 155 | { |
| 156 | if (runtime->LoadNetwork(netId, move(optNet)) != armnn::Status::Success) |
| 157 | { |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 158 | return FailPrepareModel(V1_0::ErrorStatus::GENERAL_FAILURE, "Network could not be loaded", cb); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 159 | } |
| 160 | } |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 161 | catch (std::exception& e) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 162 | { |
| 163 | stringstream message; |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 164 | message << "Exception (" << e.what()<< ") caught from LoadNetwork."; |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 165 | FailPrepareModel(V1_0::ErrorStatus::GENERAL_FAILURE, message.str(), cb); |
| 166 | return V1_0::ErrorStatus::NONE; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 167 | } |
| 168 | |
Jim Flynn | 829ad30 | 2019-12-13 14:43:24 +0000 | [diff] [blame] | 169 | // Now that we have a networkId for the graph rename the dump file to use it |
| 170 | // so that we can associate the graph file and the input/output tensor dump files |
| 171 | RenameGraphDotFile(dotGraphFileName, |
| 172 | options.GetRequestInputsAndOutputsDumpDir(), |
| 173 | netId); |
| 174 | |
Kevin May | d5e9465 | 2019-11-07 14:02:14 +0000 | [diff] [blame] | 175 | sp<ArmnnPreparedModel<HalPolicy>> preparedModel( |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 176 | new ArmnnPreparedModel<HalPolicy>( |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 177 | netId, |
| 178 | runtime.get(), |
| 179 | model, |
| 180 | options.GetRequestInputsAndOutputsDumpDir(), |
| 181 | options.IsGpuProfilingEnabled())); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 182 | |
| 183 | // Run a single 'dummy' inference of the model. This means that CL kernels will get compiled (and tuned if |
| 184 | // this is enabled) before the first 'real' inference which removes the overhead of the first inference. |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 185 | if (!preparedModel->ExecuteWithDummyInputs()) |
| 186 | { |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 187 | return FailPrepareModel(V1_0::ErrorStatus::GENERAL_FAILURE, "Network could not be executed", cb); |
Matthew Bentham | 16196e2 | 2019-04-01 17:17:58 +0100 | [diff] [blame] | 188 | } |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 189 | |
| 190 | if (clTunedParameters && |
| 191 | options.GetClTunedParametersMode() == armnn::IGpuAccTunedParameters::Mode::UpdateTunedParameters) |
| 192 | { |
| 193 | // Now that we've done one inference the CL kernel parameters will have been tuned, so save the updated file. |
| 194 | try |
| 195 | { |
| 196 | clTunedParameters->Save(options.GetClTunedParametersFile().c_str()); |
| 197 | } |
Derek Lamberti | b9cb844 | 2019-11-28 13:34:48 +0000 | [diff] [blame] | 198 | catch (std::exception& error) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 199 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 200 | ALOGE("ArmnnDriverImpl::prepareModel: Failed to save CL tuned parameters file '%s': %s", |
Matteo Martincigh | 8d50f8f | 2018-10-25 15:39:33 +0100 | [diff] [blame] | 201 | options.GetClTunedParametersFile().c_str(), error.what()); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 205 | NotifyCallbackAndCheck(cb, V1_0::ErrorStatus::NONE, preparedModel); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 206 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 207 | return V1_0::ErrorStatus::NONE; |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 208 | } |
| 209 | |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 210 | template<typename HalPolicy> |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 211 | Return<void> ArmnnDriverImpl<HalPolicy>::getSupportedOperations(const armnn::IRuntimePtr& runtime, |
| 212 | const DriverOptions& options, |
| 213 | const HalModel& model, |
| 214 | HalGetSupportedOperations_cb cb) |
| 215 | { |
Jim Flynn | 829ad30 | 2019-12-13 14:43:24 +0000 | [diff] [blame] | 216 | std::stringstream ss; |
| 217 | ss << "ArmnnDriverImpl::getSupportedOperations()"; |
| 218 | std::string fileName; |
| 219 | std::string timestamp; |
| 220 | if (!options.GetRequestInputsAndOutputsDumpDir().empty()) |
| 221 | { |
| 222 | timestamp = GetFileTimestamp(); |
| 223 | fileName = boost::str(boost::format("%1%/%2%_getSupportedOperations.txt") |
| 224 | % options.GetRequestInputsAndOutputsDumpDir() |
| 225 | % timestamp); |
| 226 | ss << " : " << fileName; |
| 227 | } |
| 228 | ALOGV(ss.str().c_str()); |
| 229 | |
| 230 | if (!options.GetRequestInputsAndOutputsDumpDir().empty()) |
| 231 | { |
| 232 | //dump the marker file |
| 233 | std::ofstream fileStream; |
| 234 | fileStream.open(fileName, std::ofstream::out | std::ofstream::trunc); |
| 235 | if (fileStream.good()) |
| 236 | { |
| 237 | fileStream << timestamp << std::endl; |
| 238 | } |
| 239 | fileStream.close(); |
| 240 | } |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 241 | |
| 242 | vector<bool> result; |
| 243 | |
| 244 | if (!runtime) |
| 245 | { |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 246 | cb(HalErrorStatus::DEVICE_UNAVAILABLE, result); |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 247 | return Void(); |
| 248 | } |
| 249 | |
| 250 | // Run general model validation, if this doesn't pass we shouldn't analyse the model anyway. |
| 251 | if (!android::nn::validateModel(model)) |
| 252 | { |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 253 | cb(HalErrorStatus::INVALID_ARGUMENT, result); |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 254 | return Void(); |
| 255 | } |
| 256 | |
| 257 | // Attempt to convert the model to an ArmNN input network (INetwork). |
| 258 | ModelToINetworkConverter<HalPolicy> modelConverter(options.GetBackends(), |
| 259 | model, |
| 260 | options.GetForcedUnsupportedOperations()); |
| 261 | |
| 262 | if (modelConverter.GetConversionResult() != ConversionResult::Success |
| 263 | && modelConverter.GetConversionResult() != ConversionResult::UnsupportedFeature) |
| 264 | { |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 265 | cb(HalErrorStatus::GENERAL_FAILURE, result); |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 266 | return Void(); |
| 267 | } |
| 268 | |
| 269 | // Check each operation if it was converted successfully and copy the flags |
| 270 | // into the result (vector<bool>) that we need to return to Android. |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 271 | result.reserve(getMainModel(model).operations.size()); |
| 272 | for (uint32_t operationIdx = 0; |
| 273 | operationIdx < getMainModel(model).operations.size(); |
| 274 | ++operationIdx) |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 275 | { |
| 276 | bool operationSupported = modelConverter.IsOperationSupported(operationIdx); |
| 277 | result.push_back(operationSupported); |
| 278 | } |
| 279 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 280 | cb(HalErrorStatus::NONE, result); |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 281 | return Void(); |
| 282 | } |
| 283 | |
| 284 | template<typename HalPolicy> |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 285 | Return<DeviceStatus> ArmnnDriverImpl<HalPolicy>::getStatus() |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 286 | { |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 287 | ALOGV("ArmnnDriver::getStatus()"); |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 288 | |
| 289 | return DeviceStatus::AVAILABLE; |
| 290 | } |
| 291 | |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 292 | /// |
| 293 | /// Class template specializations |
| 294 | /// |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 295 | |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 296 | template class ArmnnDriverImpl<hal_1_0::HalPolicy>; |
| 297 | |
Matteo Martincigh | 8b287c2 | 2018-09-07 09:25:10 +0100 | [diff] [blame] | 298 | #ifdef ARMNN_ANDROID_NN_V1_1 |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 299 | template class ArmnnDriverImpl<hal_1_1::HalPolicy>; |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 300 | #endif |
| 301 | |
Mike Kelly | b5fdf38 | 2019-06-11 16:35:25 +0100 | [diff] [blame] | 302 | #ifdef ARMNN_ANDROID_NN_V1_2 |
| 303 | template class ArmnnDriverImpl<hal_1_1::HalPolicy>; |
| 304 | template class ArmnnDriverImpl<hal_1_2::HalPolicy>; |
| 305 | #endif |
| 306 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 307 | #ifdef ARMNN_ANDROID_NN_V1_3 |
| 308 | template class ArmnnDriverImpl<hal_1_1::HalPolicy>; |
| 309 | template class ArmnnDriverImpl<hal_1_2::HalPolicy>; |
| 310 | template class ArmnnDriverImpl<hal_1_3::HalPolicy>; |
| 311 | #endif |
| 312 | |
Matteo Martincigh | 8d50f8f | 2018-10-25 15:39:33 +0100 | [diff] [blame] | 313 | } // namespace armnn_driver |