24.08
|
Go to the documentation of this file.
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();
131 VLOG(DRIVER) <<
"ArmnnDevice: ArmNN does not support AsyncExecution with the following backend: "
132 << backend.Get().c_str();
136 backends.push_back(backend);
142 if (backends.empty())
149 VLOG(DRIVER) <<
"ArmnnDevice: Created device with the following backends: " << GetBackendString(
m_Options).c_str();
152 __android_log_print(ANDROID_LOG_DEBUG,
154 "ArmnnDevice: Created device with the following backends: %s",
bool IsGpuProfilingEnabled() const
armnn::IRuntimePtr m_Runtime
bool isAsyncModelExecutionEnabled() const
@ GpuAcc
GPU Execution: OpenCL: ArmCompute.
std::unordered_set< BackendId > BackendIdSet
void ConfigureLogging(bool printToStandardOutput, bool printToDebugOutput, LogSeverity severity)
Configures the logging behaviour of the ARMNN library.
ArmnnDevice(DriverOptions options)
static IGpuAccTunedParametersPtr Create(Mode mode, TuningLevel tunerMode)
const std::string & GetClTunedParametersFile() const
void SetBackends(const std::vector< armnn::BackendId > &backends)
armnn::IGpuAccTunedParametersPtr m_ClTunedParameters
armnn::IGpuAccTunedParameters::Mode GetClTunedParametersMode() const
bool IsVerboseLoggingEnabled() const
armnn::IGpuAccTunedParameters::TuningLevel GetClTuningLevel() const
const std::vector< armnn::BackendId > & GetBackends() const
static IRuntimePtr Create(const CreationOptions &options)
std::shared_ptr< IGpuAccTunedParameters > m_GpuAccTunedParameters
If set, uses the GpuAcc tuned parameters from the given object when executing GPU workloads.
bool m_EnableGpuProfiling
Setting this flag will allow the user to obtain GPU profiling information from the runtime.
bool HasMatchingCapability(const BackendOptions::BackendOption &capability, const BackendCapabilities &capabilities)
Convenience function to check if a given capability matches a capability in a BackendCapabilities str...