summaryrefslogtreecommitdiff
path: root/neuralnetworks/aidl/utils/test/DeviceTest.cpp
diff options
context:
space:
mode:
authorMichael Butler <butlermichael@google.com>2021-11-11 20:07:46 -0800
committerMichael Butler <butlermichael@google.com>2021-11-18 23:56:15 +0000
commit34f0a8f418c45ec51bd5053e27011aed4b9b4695 (patch)
tree637f5ebf6915368e7f879e94bac94017c1df1cd4 /neuralnetworks/aidl/utils/test/DeviceTest.cpp
parent0d9ef9f0b99b56e6a8f3c9b5c41b1221c6c701ab (diff)
Make NNAPI Version more structured -- hal
Prior to this topic, NNAPI Versions were linear and represented by an enumeration. However, this did not properly account for the non-linearity of runtime-specific features such as a control flow operations with operands of dynamic sizes. This topic alters Version to be a struct containing a feature level enumeration as well as a boolean which indicates whether there are runtime-specific features. Bug: 206975939 Test: mma Test: NeuralNetworksTests_static Change-Id: I78c54ef597bf269b137f2835332bdedac49883d4
Diffstat (limited to 'neuralnetworks/aidl/utils/test/DeviceTest.cpp')
-rw-r--r--neuralnetworks/aidl/utils/test/DeviceTest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/neuralnetworks/aidl/utils/test/DeviceTest.cpp b/neuralnetworks/aidl/utils/test/DeviceTest.cpp
index 79abe1b19b..19d2314994 100644
--- a/neuralnetworks/aidl/utils/test/DeviceTest.cpp
+++ b/neuralnetworks/aidl/utils/test/DeviceTest.cpp
@@ -152,13 +152,15 @@ class DeviceTest : public ::testing::TestWithParam<nn::Version> {
};
std::string printDeviceTest(const testing::TestParamInfo<nn::Version>& info) {
- switch (info.param) {
- case nn::Version::ANDROID_S:
+ const nn::Version version = info.param;
+ CHECK(!version.runtimeOnlyFeatures);
+ switch (version.level) {
+ case nn::Version::Level::ANDROID_S:
return "v1";
- case nn::Version::FEATURE_LEVEL_6:
+ case nn::Version::Level::FEATURE_LEVEL_6:
return "v2";
default:
- LOG(FATAL) << "Invalid AIDL version: " << info.param;
+ LOG(FATAL) << "Invalid AIDL version: " << version;
return "invalid";
}
}