#include <ArmnnDriver.hpp>
|
| ArmnnDriver (DriverOptions options) |
|
| ~ArmnnDriver () |
|
const std::string & | getName () const override |
|
const std::string & | getVersionString () const override |
|
Version | getFeatureLevel () const override |
|
DeviceType | getType () const override |
|
const std::vector< Extension > & | getSupportedExtensions () const override |
|
const Capabilities & | getCapabilities () const override |
|
std::pair< uint32_t, uint32_t > | getNumberOfCacheFilesNeeded () const override |
|
GeneralResult< void > | wait () const override |
|
GeneralResult< std::vector< bool > > | getSupportedOperations (const Model &model) const override |
|
GeneralResult< SharedPreparedModel > | prepareModel (const Model &model, ExecutionPreference preference, Priority priority, OptionalTimePoint deadline, const std::vector< SharedHandle > &modelCache, const std::vector< SharedHandle > &dataCache, const CacheToken &token, const std::vector< android::nn::TokenValuePair > &hints, const std::vector< android::nn::ExtensionNameAndPrefix > &extensionNameToPrefix) const override |
|
GeneralResult< SharedPreparedModel > | prepareModelFromCache (OptionalTimePoint deadline, const std::vector< SharedHandle > &modelCache, const std::vector< SharedHandle > &dataCache, const CacheToken &token) const override |
|
GeneralResult< SharedBuffer > | allocate (const BufferDesc &, const std::vector< SharedPreparedModel > &, const std::vector< BufferRole > &, const std::vector< BufferRole > &) const override |
|
Definition at line 31 of file ArmnnDriver.hpp.
◆ ArmnnDriver()
Definition at line 35 of file ArmnnDriver.hpp.
38 VLOG(DRIVER) <<
"ArmnnDriver::ArmnnDriver()";
ArmnnDevice(DriverOptions options)
◆ ~ArmnnDriver()
Definition at line 40 of file ArmnnDriver.hpp.
42 VLOG(DRIVER) <<
"ArmnnDriver::~ArmnnDriver()";
◆ allocate()
GeneralResult<SharedBuffer> allocate |
( |
const BufferDesc & |
, |
|
|
const std::vector< SharedPreparedModel > & |
, |
|
|
const std::vector< BufferRole > & |
, |
|
|
const std::vector< BufferRole > & |
|
|
) |
| const |
|
inlineoverride |
Definition at line 232 of file ArmnnDriver.hpp.
237 VLOG(DRIVER) <<
"ArmnnDriver::allocate()";
238 return NN_ERROR(ErrorStatus::INVALID_ARGUMENT) <<
"ArmnnDriver::allocate -- does not support allocate.";
◆ getCapabilities()
const Capabilities& getCapabilities |
( |
| ) |
const |
|
inlineoverride |
◆ getFeatureLevel()
Version getFeatureLevel |
( |
| ) |
const |
|
inlineoverride |
Definition at line 61 of file ArmnnDriver.hpp.
63 VLOG(DRIVER) <<
"ArmnnDriver::getFeatureLevel()";
64 return kVersionFeatureLevel6;
◆ getName()
const std::string& getName |
( |
| ) |
const |
|
inlineoverride |
Definition at line 47 of file ArmnnDriver.hpp.
49 VLOG(DRIVER) <<
"ArmnnDriver::getName()";
50 static const std::string name =
"arm-armnn-sl";
◆ getNumberOfCacheFilesNeeded()
std::pair<uint32_t, uint32_t> getNumberOfCacheFilesNeeded |
( |
| ) |
const |
|
inlineoverride |
Definition at line 86 of file ArmnnDriver.hpp.
References DriverOptions::GetBackends(), armnn::GetNumberOfCacheFiles(), and ArmnnDevice::m_Options.
88 VLOG(DRIVER) <<
"ArmnnDriver::getNumberOfCacheFilesNeeded()";
89 unsigned int numberOfCachedModelFiles = 0;
93 VLOG(DRIVER) <<
"ArmnnDriver::getNumberOfCacheFilesNeeded() = " << std::to_string(numberOfCachedModelFiles);
95 return std::make_pair(numberOfCachedModelFiles, 1ul);
unsigned int GetNumberOfCacheFiles(const armnn::BackendId &backend)
Returns the number of cached files if backend supports caching.
const std::vector< armnn::BackendId > & GetBackends() const
◆ getSupportedExtensions()
const std::vector<Extension>& getSupportedExtensions |
( |
| ) |
const |
|
inlineoverride |
Definition at line 73 of file ArmnnDriver.hpp.
75 VLOG(DRIVER) <<
"ArmnnDriver::getSupportedExtensions()";
76 static const std::vector<Extension> extensions = {};
◆ getSupportedOperations()
GeneralResult<std::vector<bool> > getSupportedOperations |
( |
const Model & |
model | ) |
const |
|
inlineoverride |
Definition at line 104 of file ArmnnDriver.hpp.
References DriverOptions::GetBackends(), DriverOptions::GetForcedUnsupportedOperations(), DriverOptions::GetRequestInputsAndOutputsDumpDir(), ModelToINetworkTransformer::IsOperationSupported(), ArmnnDevice::m_Options, ArmnnDevice::m_Runtime, armnn_driver::Success, and armnn_driver::UnsupportedFeature.
106 VLOG(DRIVER) <<
"ArmnnDriver::getSupportedOperations()";
108 std::stringstream ss;
109 ss <<
"ArmnnDriverImpl::getSupportedOperations()";
110 std::string fileName;
111 std::string timestamp;
118 <<
"_getSupportedOperations.txt";
120 VLOG(DRIVER) << ss.str().c_str();
125 std::ofstream fileStream;
126 fileStream.open(fileName, std::ofstream::out | std::ofstream::trunc);
127 if (fileStream.good())
129 fileStream << timestamp << std::endl;
130 fileStream << timestamp << std::endl;
135 std::vector<bool> result;
138 return NN_ERROR(ErrorStatus::DEVICE_UNAVAILABLE) <<
"Device Unavailable!";
142 if (
const auto result = validate(model); !result.ok())
144 return NN_ERROR(ErrorStatus::INVALID_ARGUMENT) <<
"Invalid Model!";
155 return NN_ERROR(ErrorStatus::GENERAL_FAILURE) <<
"Conversion Error!";
160 result.reserve(model.main.operations.size());
161 for (uint32_t operationIdx = 0; operationIdx < model.main.operations.size(); ++operationIdx)
164 result.push_back(operationSupported);
const std::set< unsigned int > & GetForcedUnsupportedOperations() const
armnn::IRuntimePtr m_Runtime
const std::string & GetRequestInputsAndOutputsDumpDir() const
const std::vector< armnn::BackendId > & GetBackends() const
◆ getType()
DeviceType getType |
( |
| ) |
const |
|
inlineoverride |
Definition at line 67 of file ArmnnDriver.hpp.
69 VLOG(DRIVER) <<
"ArmnnDriver::getType()";
70 return DeviceType::CPU;
◆ getVersionString()
const std::string& getVersionString |
( |
| ) |
const |
|
inlineoverride |
Definition at line 54 of file ArmnnDriver.hpp.
References ARMNN_VERSION.
56 VLOG(DRIVER) <<
"ArmnnDriver::getVersionString()";
#define ARMNN_VERSION
ARMNN_VERSION: "X.Y.Z" where: X = Major version number Y = Minor version number Z = Patch version num...
◆ prepareModel()
GeneralResult<SharedPreparedModel> prepareModel |
( |
const Model & |
model, |
|
|
ExecutionPreference |
preference, |
|
|
Priority |
priority, |
|
|
OptionalTimePoint |
deadline, |
|
|
const std::vector< SharedHandle > & |
modelCache, |
|
|
const std::vector< SharedHandle > & |
dataCache, |
|
|
const CacheToken & |
token, |
|
|
const std::vector< android::nn::TokenValuePair > & |
hints, |
|
|
const std::vector< android::nn::ExtensionNameAndPrefix > & |
extensionNameToPrefix |
|
) |
| const |
|
inlineoverride |
Definition at line 170 of file ArmnnDriver.hpp.
References DriverOptions::GetFp16Enabled(), ArmnnDevice::m_ClTunedParameters, ArmnnDevice::m_Options, ArmnnDevice::m_Runtime, and ArmnnDriverImpl::PrepareArmnnModel().
180 VLOG(DRIVER) <<
"ArmnnDriver::prepareModel()";
183 if (
const auto result = validate(model); !result.ok()) {
184 return NN_ERROR(ErrorStatus::INVALID_ARGUMENT) <<
"Invalid Model: " << result.error();
186 if (
const auto result = validate(preference); !result.ok()) {
187 return NN_ERROR(ErrorStatus::INVALID_ARGUMENT)
188 <<
"Invalid ExecutionPreference: " << result.error();
190 if (
const auto result = validate(priority); !result.ok()) {
191 return NN_ERROR(ErrorStatus::INVALID_ARGUMENT) <<
"Invalid Priority: " << result.error();
195 if (hasDeadlinePassed(deadline)) {
196 return NN_ERROR(ErrorStatus::MISSED_DEADLINE_PERSISTENT);
armnn::IGpuAccTunedParametersPtr m_ClTunedParameters
bool GetFp16Enabled() const
armnn::IRuntimePtr m_Runtime
static GeneralResult< SharedPreparedModel > PrepareArmnnModel(const armnn::IRuntimePtr &runtime, const armnn::IGpuAccTunedParametersPtr &clTunedParameters, const DriverOptions &options, const Model &model, const std::vector< SharedHandle > &modelCacheHandle, const std::vector< SharedHandle > &dataCacheHandle, const CacheToken &token, bool float32ToFloat16=false, Priority priority=Priority::MEDIUM)
◆ prepareModelFromCache()
GeneralResult<SharedPreparedModel> prepareModelFromCache |
( |
OptionalTimePoint |
deadline, |
|
|
const std::vector< SharedHandle > & |
modelCache, |
|
|
const std::vector< SharedHandle > & |
dataCache, |
|
|
const CacheToken & |
token |
|
) |
| const |
|
inlineoverride |
Definition at line 210 of file ArmnnDriver.hpp.
References DriverOptions::GetFp16Enabled(), ArmnnDevice::m_ClTunedParameters, ArmnnDevice::m_Options, ArmnnDevice::m_Runtime, and ArmnnDriverImpl::PrepareArmnnModelFromCache().
215 VLOG(DRIVER) <<
"ArmnnDriver::prepareModelFromCache()";
218 if (hasDeadlinePassed(deadline)) {
219 return NN_ERROR(ErrorStatus::MISSED_DEADLINE_PERSISTENT);
armnn::IGpuAccTunedParametersPtr m_ClTunedParameters
bool GetFp16Enabled() const
armnn::IRuntimePtr m_Runtime
static GeneralResult< SharedPreparedModel > PrepareArmnnModelFromCache(const armnn::IRuntimePtr &runtime, const armnn::IGpuAccTunedParametersPtr &clTunedParameters, const DriverOptions &options, const std::vector< SharedHandle > &modelCacheHandle, const std::vector< SharedHandle > &dataCacheHandle, const CacheToken &token, bool float32ToFloat16=false)
◆ wait()
GeneralResult<void> wait |
( |
| ) |
const |
|
inlineoverride |
Definition at line 98 of file ArmnnDriver.hpp.
100 VLOG(DRIVER) <<
"ArmnnDriver::wait()";
The documentation for this class was generated from the following file: