diff options
Diffstat (limited to '1.2')
-rw-r--r-- | 1.2/ArmnnDriver.hpp | 16 | ||||
-rw-r--r-- | 1.2/ArmnnDriverImpl.cpp | 12 | ||||
-rw-r--r-- | 1.2/ArmnnDriverImpl.hpp | 4 |
3 files changed, 18 insertions, 14 deletions
diff --git a/1.2/ArmnnDriver.hpp b/1.2/ArmnnDriver.hpp index 6dba2e9a..5227272f 100644 --- a/1.2/ArmnnDriver.hpp +++ b/1.2/ArmnnDriver.hpp @@ -93,9 +93,9 @@ public: { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_1()"); - if (!(preference == ExecutionPreference::LOW_POWER || - preference == ExecutionPreference::FAST_SINGLE_ANSWER || - preference == ExecutionPreference::SUSTAINED_SPEED)) + if (!(preference == V1_1::ExecutionPreference::LOW_POWER || + preference == V1_1::ExecutionPreference::FAST_SINGLE_ANSWER || + preference == V1_1::ExecutionPreference::SUSTAINED_SPEED)) { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_1: Invalid execution preference"); cb->notify(V1_0::ErrorStatus::INVALID_ARGUMENT, nullptr); @@ -111,7 +111,7 @@ public: && m_Options.GetFp16Enabled()); } - Return<DeviceStatus> getStatus() override + Return<V1_0::DeviceStatus> getStatus() override { ALOGV("hal_1_2::ArmnnDriver::getStatus()"); @@ -138,7 +138,7 @@ public: const android::hardware::hidl_vec<android::hardware::hidl_handle>&, const android::hardware::hidl_vec<android::hardware::hidl_handle>&, const HidlToken&, - const sp<V1_2::IPreparedModelCallback>& callback) + const android::sp<V1_2::IPreparedModelCallback>& callback) { ALOGV("hal_1_2::ArmnnDriver::prepareModelFromCache()"); callback->notify_1_2(V1_0::ErrorStatus::GENERAL_FAILURE, nullptr); @@ -152,9 +152,9 @@ public: { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_2()"); - if (!(preference == ExecutionPreference::LOW_POWER || - preference == ExecutionPreference::FAST_SINGLE_ANSWER || - preference == ExecutionPreference::SUSTAINED_SPEED)) + if (!(preference == V1_1::ExecutionPreference::LOW_POWER || + preference == V1_1::ExecutionPreference::FAST_SINGLE_ANSWER || + preference == V1_1::ExecutionPreference::SUSTAINED_SPEED)) { ALOGV("hal_1_2::ArmnnDriver::prepareModel_1_2: Invalid execution preference"); cb->notify(V1_0::ErrorStatus::INVALID_ARGUMENT, nullptr); diff --git a/1.2/ArmnnDriverImpl.cpp b/1.2/ArmnnDriverImpl.cpp index 94fb3c88..d35826e7 100644 --- a/1.2/ArmnnDriverImpl.cpp +++ b/1.2/ArmnnDriverImpl.cpp @@ -56,9 +56,9 @@ const char *g_OperandTypeInt32PerformanceExecTime = "Armnn.operandType const char *g_OperandTypeInt32PerformancePowerUsage = "Armnn.operandTypeInt32Performance.powerUsage"; -void NotifyCallbackAndCheck(const sp<V1_2::IPreparedModelCallback>& callback, +void NotifyCallbackAndCheck(const android::sp<V1_2::IPreparedModelCallback>& callback, V1_0::ErrorStatus errorStatus, - const sp<V1_2::IPreparedModel>& preparedModelPtr) + const android::sp<V1_2::IPreparedModel>& preparedModelPtr) { Return<void> returned = callback->notify_1_2(errorStatus, preparedModelPtr); // This check is required, if the callback fails and it isn't checked it will bring down the service @@ -71,7 +71,7 @@ void NotifyCallbackAndCheck(const sp<V1_2::IPreparedModelCallback>& callback, Return<V1_0::ErrorStatus> FailPrepareModel(V1_0::ErrorStatus error, const std::string& message, - const sp<V1_2::IPreparedModelCallback>& callback) + const android::sp<V1_2::IPreparedModelCallback>& callback) { ALOGW("ArmnnDriverImpl::prepareModel: %s", message.c_str()); NotifyCallbackAndCheck(callback, error, nullptr); @@ -90,7 +90,7 @@ Return<V1_0::ErrorStatus> ArmnnDriverImpl::prepareArmnnModel_1_2( const armnn::IGpuAccTunedParametersPtr& clTunedParameters, const DriverOptions& options, const V1_2::Model& model, - const sp<V1_2::IPreparedModelCallback>& cb, + const android::sp<V1_2::IPreparedModelCallback>& cb, bool float32ToFloat16) { ALOGV("ArmnnDriverImpl::prepareArmnnModel_1_2()"); @@ -267,7 +267,7 @@ Return<void> ArmnnDriverImpl::getCapabilities_1_2(const armnn::IRuntimePtr& runt ParseSystemProperty(g_RelaxedFloat32toFloat16PerformancePowerUsage, defaultValue); // Set the base value for all operand types - #ifdef ARMNN_ANDROID_R + #if defined(ARMNN_ANDROID_R) || defined(ARMNN_ANDROID_S) capabilities.operandPerformance = nonExtensionOperandPerformance<HalVersion::V1_2>({FLT_MAX, FLT_MAX}); #else capabilities.operandPerformance = nonExtensionOperandPerformance({FLT_MAX, FLT_MAX}); @@ -346,7 +346,7 @@ Return<void> ArmnnDriverImpl::getCapabilities_1_2(const armnn::IRuntimePtr& runt capabilities.relaxedFloat32toFloat16PerformanceTensor.powerUsage = 0; // Set the base value for all operand types - #ifdef ARMNN_ANDROID_R + #if defined(ARMNN_ANDROID_R) || defined(ARMNN_ANDROID_S) capabilities.operandPerformance = nonExtensionOperandPerformance<HalVersion::V1_2>({0.f, 0.0f}); #else capabilities.operandPerformance = nonExtensionOperandPerformance({0.f, 0.0f}); diff --git a/1.2/ArmnnDriverImpl.hpp b/1.2/ArmnnDriverImpl.hpp index 73ba133e..eeb491b6 100644 --- a/1.2/ArmnnDriverImpl.hpp +++ b/1.2/ArmnnDriverImpl.hpp @@ -15,6 +15,10 @@ using namespace android::nn::hal; #endif +#ifdef ARMNN_ANDROID_S +using namespace android::hardware; +#endif + namespace V1_0 = ::android::hardware::neuralnetworks::V1_0; namespace V1_2 = ::android::hardware::neuralnetworks::V1_2; |