diff options
author | Michael Butler <butlermichael@google.com> | 2018-01-23 11:05:43 -0800 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2018-01-31 15:40:17 -0800 |
commit | 49eabb44c52aa528573d52d175d13c6dd08406a0 (patch) | |
tree | 377ca266505203fe5ff13bfce4d5dcf34e79deab /nn/runtime/test/TestPartitioningRandom.cpp | |
parent | b15a72fd7a495827403fff1e3db1c89b53d5a669 (diff) | |
download | ml-49eabb44c52aa528573d52d175d13c6dd08406a0.tar.gz |
Upgrade NeuralNetworks v1.0 to v1.1.
For Android P, the NNAPI is getting new operations. To support this
change, the NN runtime needs to handle both v1.0 and v1.1. This change
brings the NN runtime up to v1.1 and adds a VersionedIDevice class which
manages both v1.0 and v1.1 calls.
Test: mm
Test: cts and vts test binaries
Change-Id: Iaec1dcfe00c1712a0ac89954ae142d4ea126989d
(cherry picked from commit 75886e77f9ca074173a49283b5c0a8c182d98977)
Diffstat (limited to 'nn/runtime/test/TestPartitioningRandom.cpp')
-rw-r--r-- | nn/runtime/test/TestPartitioningRandom.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nn/runtime/test/TestPartitioningRandom.cpp b/nn/runtime/test/TestPartitioningRandom.cpp index 381eb7afc..a89730b84 100644 --- a/nn/runtime/test/TestPartitioningRandom.cpp +++ b/nn/runtime/test/TestPartitioningRandom.cpp @@ -95,7 +95,7 @@ using CompilationBuilder = nn::CompilationBuilder; using Device = nn::Device; using DeviceManager = nn::DeviceManager; using ExecutionPlan = nn::ExecutionPlan; -using HidlModel = hardware::neuralnetworks::V1_0::Model; +using HidlModel = hardware::neuralnetworks::V1_1::Model; using MemoryBuilder = nn::Memory; using ModelBuilder = nn::ModelBuilder; using Result = nn::wrapper::Result; @@ -489,7 +489,10 @@ public: return Void(); } - Return<void> getSupportedOperations(const Model& model, getSupportedOperations_cb cb) override { + Return<void> getSupportedOperations(const V1_0::Model& modelV1_0, + getSupportedOperations_cb cb) override { + V1_1::Model model = android::nn::convertToV1_1(modelV1_0); + if (nn::validateModel(model)) { const size_t count = model.operations.size(); std::vector<bool> supported(count); @@ -508,7 +511,7 @@ public: return Void(); } - Return<ErrorStatus> prepareModel(const Model& model, + Return<ErrorStatus> prepareModel(const V1_0::Model& model, const sp<IPreparedModelCallback>& callback) override { // NOTE: We verify that all operations in the model are supported. ErrorStatus outStatus = ErrorStatus::INVALID_ARGUMENT; |