6 #define LOG_TAG "arm-armnn-sl" 10 #include <LegacyUtils.h> 11 #include <OperationsUtils.h> 19 #include <android/log.h> 27 std::stringstream backends;
32 return backends.str();
43 : m_Runtime(nullptr, nullptr)
44 , m_ClTunedParameters(nullptr)
45 , m_Options(
std::move(options))
62 VLOG(DRIVER) <<
"ArmnnDevice::ArmnnDevice()";
65 __android_log_print(ANDROID_LOG_DEBUG,
"ARMNN_SL",
"ArmnnDevice::ArmnnDevice()");
71 SetMinimumLogSeverity(android::base::VERBOSE);
75 SetMinimumLogSeverity(android::base::INFO);
93 catch (std::exception& error)
96 VLOG(DRIVER) <<
"ArmnnDevice: Failed to load CL tuned parameters file " 104 VLOG(DRIVER) <<
"ArmnnDevice: Failed to setup CL runtime: %s. Device will be unavailable." << error.
what();
106 catch (std::exception& error)
108 VLOG(DRIVER) <<
"ArmnnDevice: Unknown exception: %s. Device will be unavailable." << error.what();
114 std::vector<armnn::BackendId> backends;
121 if (std::find(supportedDevices.cbegin(), supportedDevices.cend(), backend) == supportedDevices.cend())
123 VLOG(DRIVER) <<
"ArmnnDevice: Requested unknown backend " << backend.Get().c_str();
127 backends.push_back(backend);
132 if (backends.empty())
139 VLOG(DRIVER) <<
"ArmnnDevice: Created device with the following backends: " << GetBackendString(
m_Options).c_str();
142 __android_log_print(ANDROID_LOG_DEBUG,
144 "ArmnnDevice: Created device with the following backends: %s",
static IRuntimePtr Create(const CreationOptions &options)
std::unordered_set< BackendId > BackendIdSet
void ConfigureLogging(bool printToStandardOutput, bool printToDebugOutput, LogSeverity severity)
Configures the logging behaviour of the ARMNN library.
static IGpuAccTunedParametersPtr Create(Mode mode, TuningLevel tunerMode)
armnn::IGpuAccTunedParametersPtr m_ClTunedParameters
virtual const char * what() const noexcept override
bool IsVerboseLoggingEnabled() const
armnn::IRuntimePtr m_Runtime
std::shared_ptr< IGpuAccTunedParameters > m_GpuAccTunedParameters
If set, uses the GpuAcc tuned parameters from the given object when executing GPU workloads...
armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const
ArmnnDevice(DriverOptions options)
GPU Execution: OpenCL: ArmCompute.
bool m_EnableGpuProfiling
Setting this flag will allow the user to obtain GPU profiling information from the runtime...
armnn::IGpuAccTunedParameters::TuningLevel GetClTuningLevel() const
void SetBackends(const std::vector< armnn::BackendId > &backends)
const std::vector< armnn::BackendId > & GetBackends() const
bool IsGpuProfilingEnabled() const
const std::string & GetClTunedParametersFile() const