summaryrefslogtreecommitdiff
path: root/nn/runtime/test/TestPartitioningRandom.cpp
diff options
context:
space:
mode:
authorMichael Butler <butlermichael@google.com>2018-01-31 17:09:42 -0800
committerMiao Wang <miaowang@google.com>2018-03-05 12:50:47 -0800
commit3a7db92d9a21108414c6d0d76c18f831ca88fceb (patch)
tree6543b4f644f0bcbc933f871c51ca4d37e22a3233 /nn/runtime/test/TestPartitioningRandom.cpp
parent07c1adad1f2f87d230bb2d79b42d7383471ff4b0 (diff)
downloadml-3a7db92d9a21108414c6d0d76c18f831ca88fceb.tar.gz
Upgrade 1.0 sample driver to 1.1
This CL updates the 1.0 sample drivers to 1.1. Because V1_1::IDevice inherits from V1_0::IDevice, the sample driver can still be used as a 1.0 driver. When the NN runtime holds a 1.1 driver, it will always use its updated *_1_1 function calls; to verify the NN runtime is still compliant with 1.0 drivers, the VTS framework generates a binary called 'android.hardware.neuralnetworks@1.0-adapter' to fake a 1.0 driver using a 1.1+ driver. This change additionally updates RandomPartitioningTest to use the 1.1 version of SampleDriver, and removes driver/Android.bp since it is no longer needed in the build system. Bug: 63911257 Test: mm Test: cts and vts test binaries Merged-In: I1f98d1329571a4571c1b8d5f532ca04dad5a59ca Change-Id: I1f98d1329571a4571c1b8d5f532ca04dad5a59ca (cherry picked from commit d56b2323c6e367d77bc226c5e35908d9512af79e)
Diffstat (limited to 'nn/runtime/test/TestPartitioningRandom.cpp')
-rw-r--r--nn/runtime/test/TestPartitioningRandom.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/nn/runtime/test/TestPartitioningRandom.cpp b/nn/runtime/test/TestPartitioningRandom.cpp
index a89730b84..6f160a2fc 100644
--- a/nn/runtime/test/TestPartitioningRandom.cpp
+++ b/nn/runtime/test/TestPartitioningRandom.cpp
@@ -489,10 +489,8 @@ public:
return Void();
}
- Return<void> getSupportedOperations(const V1_0::Model& modelV1_0,
- getSupportedOperations_cb cb) override {
- V1_1::Model model = android::nn::convertToV1_1(modelV1_0);
-
+ Return<void> getSupportedOperations_1_1(const HidlModel& model,
+ getSupportedOperations_cb cb) override {
if (nn::validateModel(model)) {
const size_t count = model.operations.size();
std::vector<bool> supported(count);
@@ -511,11 +509,11 @@ public:
return Void();
}
- Return<ErrorStatus> prepareModel(const V1_0::Model& model,
- const sp<IPreparedModelCallback>& callback) override {
+ Return<ErrorStatus> prepareModel_1_1(const HidlModel& model,
+ const sp<IPreparedModelCallback>& callback) override {
// NOTE: We verify that all operations in the model are supported.
ErrorStatus outStatus = ErrorStatus::INVALID_ARGUMENT;
- auto ret = getSupportedOperations(
+ auto ret = getSupportedOperations_1_1(
model,
[&outStatus](ErrorStatus inStatus, const hidl_vec<bool>& supportedOperations) {
if (inStatus == ErrorStatus::NONE) {
@@ -526,7 +524,7 @@ public:
}
});
if (ret.isOk() && (outStatus == ErrorStatus::NONE)) {
- return SampleDriver::prepareModel(model, callback);
+ return SampleDriver::prepareModel_1_1(model, callback);
} else {
callback->notify(ErrorStatus::INVALID_ARGUMENT, nullptr);
return ErrorStatus::INVALID_ARGUMENT;