summaryrefslogtreecommitdiff
path: root/nn/runtime/Manager.cpp
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2018-10-01 11:54:50 -0700
committerMiao Wang <miaowang@google.com>2018-10-24 16:23:59 -0700
commitb00589a5cc7b807ec3df15b41a7511c235af2948 (patch)
tree330061163d3b33481d744744897a7c5c0dc923af /nn/runtime/Manager.cpp
parenta598d2aef293bcfc04fcca98576de4b6f472259f (diff)
downloadml-b00589a5cc7b807ec3df15b41a7511c235af2948.tar.gz
Implement the following introspection APIs:
- ANeuralNetworks_getNumDevices - ANeuralNetworks_getDevice - ANeuralNetworksDevice_getName - ANeuralNetworksDevice_getVersion - ANeuralNetworksDevice_getFeatureLevel The above APIs are added to NDK, with corresponding NNAPI runtime changes. Validation tests are also added for each API listed above. Bug: 112661538 Bug: 112661284 Bug: 111425781 Test: mm Test: NeuralNetworksTest_static Change-Id: If58fe70d3f9a79c2588c80f4709447bcacd97e09
Diffstat (limited to 'nn/runtime/Manager.cpp')
-rw-r--r--nn/runtime/Manager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/nn/runtime/Manager.cpp b/nn/runtime/Manager.cpp
index 33b2429f3..25172b935 100644
--- a/nn/runtime/Manager.cpp
+++ b/nn/runtime/Manager.cpp
@@ -58,6 +58,13 @@ bool Device::initialize() {
mRelaxedFloat32toFloat16Performance = capabilities.relaxedFloat32toFloat16Performance;
}
+ auto result = mInterface.getVersionString();
+ // TODO(miaowang): add a validation test case for in case of error.
+ if (result.first != ErrorStatus::NONE) {
+ LOG(ERROR) << "IDevice::getVersionString returned the error " << toString(status);
+ } else {
+ mVersionString = result.second;
+ }
return status == ErrorStatus::NONE;
}