aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin May <kevin.may@arm.com>2020-03-31 15:03:42 +0100
committerKevin May <kevin.may@arm.com>2020-03-31 16:18:26 +0000
commit352d83857d28a37821a5a6643f0ed21115c66cd7 (patch)
tree1d80cab176605e7e6a361c787eeb107f69d0acad
parent51ba2c6e0f83d2891a92c63fc30001de761e0789 (diff)
downloadandroid-nn-driver-352d83857d28a37821a5a6643f0ed21115c66cd7.tar.gz
IVGCVSW-4640 Fix HAL 1.3 build issues from update of AOSP master
Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I19dd23f938f571f3f63bb1e070d27d27cbe65c1a
-rw-r--r--1.3/ArmnnDriver.hpp7
-rw-r--r--ArmnnPreparedModel_1_3.cpp19
-rw-r--r--ArmnnPreparedModel_1_3.hpp3
-rw-r--r--Utils.cpp2
4 files changed, 19 insertions, 12 deletions
diff --git a/1.3/ArmnnDriver.hpp b/1.3/ArmnnDriver.hpp
index be35593..798c438 100644
--- a/1.3/ArmnnDriver.hpp
+++ b/1.3/ArmnnDriver.hpp
@@ -260,7 +260,6 @@ public:
}
Return<ErrorStatus> prepareModelFromCache_1_3(
- V1_3::Priority,
const V1_3::OptionalTimePoint&,
const android::hardware::hidl_vec<android::hardware::hidl_handle>&,
const android::hardware::hidl_vec<android::hardware::hidl_handle>&,
@@ -272,12 +271,6 @@ public:
return ErrorStatus::GENERAL_FAILURE;
}
- Return<void> supportsDeadlines(supportsDeadlines_cb cb) {
- // Set both numbers to be false for deadlines not supported.
- cb(/*prepareModelDeadline=*/false, /*executionDeadline=*/false);
- return Void();
- }
-
Return<void> allocate(const V1_3::BufferDesc& /*desc*/,
const hidl_vec<sp<V1_3::IPreparedModel>>& /*preparedModels*/,
const hidl_vec<V1_3::BufferRole>& /*inputRoles*/,
diff --git a/ArmnnPreparedModel_1_3.cpp b/ArmnnPreparedModel_1_3.cpp
index 155f8b2..86c0494 100644
--- a/ArmnnPreparedModel_1_3.cpp
+++ b/ArmnnPreparedModel_1_3.cpp
@@ -234,6 +234,7 @@ Return <V1_3::ErrorStatus> ArmnnPreparedModel_1_3<HalVersion>::execute_1_3(
const V1_3::Request& request,
MeasureTiming measureTiming,
const V1_3::OptionalTimePoint&,
+ const V1_3::OptionalTimeoutDuration&,
const sp<V1_3::IExecutionCallback>& callback)
{
if (callback.get() == nullptr)
@@ -259,6 +260,7 @@ Return<void> ArmnnPreparedModel_1_3<HalVersion>::executeFenced(const V1_3::Reque
MeasureTiming,
const OptionalTimePoint&,
const OptionalTimeoutDuration&,
+ const OptionalTimeoutDuration&,
executeFenced_cb cb)
{
cb(ErrorStatus::DEVICE_UNAVAILABLE, hidl_handle(nullptr), nullptr);
@@ -449,10 +451,12 @@ Return<void> ArmnnPreparedModel_1_3<HalVersion>::executeSynchronously(const V1_0
}
template<typename HalVersion>
-Return<void> ArmnnPreparedModel_1_3<HalVersion>::executeSynchronously_1_3(const V1_3::Request& request,
- MeasureTiming measureTiming,
- const V1_3::OptionalTimePoint& deadline,
- executeSynchronously_1_3_cb cb)
+Return<void> ArmnnPreparedModel_1_3<HalVersion>::executeSynchronously_1_3(
+ const V1_3::Request& request,
+ MeasureTiming measureTiming,
+ const V1_3::OptionalTimePoint& deadline,
+ const V1_3::OptionalTimeoutDuration& loopTimeoutDuration,
+ executeSynchronously_1_3_cb cb)
{
ALOGV("ArmnnPreparedModel_1_3::executeSynchronously_1_3(): %s", GetModelSummary(m_Model).c_str());
m_RequestCount++;
@@ -470,6 +474,13 @@ Return<void> ArmnnPreparedModel_1_3<HalVersion>::executeSynchronously_1_3(const
return Void();
}
+ if (loopTimeoutDuration.getDiscriminator() != OptionalTimeoutDuration::hidl_discriminator::none)
+ {
+ ALOGE("ArmnnPreparedModel_1_3::executeSynchronously_1_3 invalid request model");
+ cb(V1_3::ErrorStatus::INVALID_ARGUMENT, {}, g_NoTiming);
+ return Void();
+ }
+
auto cbWrapper = [cb](V1_3::ErrorStatus errorStatus,
std::vector<OutputShape> outputShapes,
const Timing& timing,
diff --git a/ArmnnPreparedModel_1_3.hpp b/ArmnnPreparedModel_1_3.hpp
index 247149c..47529aa 100644
--- a/ArmnnPreparedModel_1_3.hpp
+++ b/ArmnnPreparedModel_1_3.hpp
@@ -60,6 +60,7 @@ public:
Return<V1_3::ErrorStatus> execute_1_3(const V1_3::Request& request,
V1_2::MeasureTiming measure,
const V1_3::OptionalTimePoint&,
+ const V1_3::OptionalTimeoutDuration&,
const sp<V1_3::IExecutionCallback>& callback) override;
Return<void> executeSynchronously(const V1_0::Request &request,
@@ -69,12 +70,14 @@ public:
Return<void> executeSynchronously_1_3(const V1_3::Request &request,
MeasureTiming measure,
const V1_3::OptionalTimePoint& deadline,
+ const V1_3::OptionalTimeoutDuration& loopTimeoutDuration,
V1_3::IPreparedModel::executeSynchronously_1_3_cb cb) override;
Return<void> executeFenced(const V1_3::Request& request,
const android::hardware::hidl_vec<android::hardware::hidl_handle>& wait_for,
MeasureTiming measure,
const V1_3::OptionalTimePoint& deadline,
+ const V1_3::OptionalTimeoutDuration& loopTimeoutDuration,
const V1_3::OptionalTimeoutDuration& duration,
executeFenced_cb callback) override;
diff --git a/Utils.cpp b/Utils.cpp
index aeee800..40d6063 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -210,7 +210,7 @@ armnn::TensorInfo GetTensorInfoForOperand(const V1_3::Operand& operand)
{
// ExtraParams is expected to be of type channelQuant
BOOST_ASSERT(operand.extraParams.getDiscriminator() ==
- V1_3::Operand::ExtraParams::hidl_discriminator::channelQuant);
+ V1_2::Operand::ExtraParams::hidl_discriminator::channelQuant);
auto perAxisQuantParams = operand.extraParams.channelQuant();