summaryrefslogtreecommitdiff
path: root/nn/driver/sample/SampleDriverFull.cpp
diff options
context:
space:
mode:
authorSlava Shklyaev <slavash@google.com>2020-08-13 13:16:03 +0100
committerSlava Shklyaev <slavash@google.com>2020-11-02 10:07:07 +0000
commitcbcaa00003cf5a4597460dbb5f8cb9f992e939e7 (patch)
treefcfc08ec92b731594fc96c586e1207bccce2624d /nn/driver/sample/SampleDriverFull.cpp
parente4a030ef549d8d2c279436628c961eb3f70df7d6 (diff)
downloadml-cbcaa00003cf5a4597460dbb5f8cb9f992e939e7.tar.gz
Migrate NNAPI runtime to canonical types
This change replaces most uses of HAL types in the codebase with equivalent canonical types. Later changes will introduce more refactorings. Also removes unused files nn/runtime/test/Bridge.{h,cpp}. Bug: 160669906 Fix: 155923931 Test: NeuralNetworksTest_static (all 7 passes) Test: NeuralNetworksTest_operations Test: NeuralNetworksTest_utils Test: NeuralNetworksTest_logtag Test: nnCache_test Test: BlobCache_test Change-Id: I63fa286e926a096948f1b1b172d1d562c4f52f29 Merged-In: I63fa286e926a096948f1b1b172d1d562c4f52f29 (cherry picked from commit 069993366ce59913ff162ed144749bb8794d990c)
Diffstat (limited to 'nn/driver/sample/SampleDriverFull.cpp')
-rw-r--r--nn/driver/sample/SampleDriverFull.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/nn/driver/sample/SampleDriverFull.cpp b/nn/driver/sample/SampleDriverFull.cpp
index e0f15eaa3..efd5e60a3 100644
--- a/nn/driver/sample/SampleDriverFull.cpp
+++ b/nn/driver/sample/SampleDriverFull.cpp
@@ -27,37 +27,35 @@ namespace android {
namespace nn {
namespace sample_driver {
-using namespace hal;
-
-Return<void> SampleDriverFull::getCapabilities_1_3(getCapabilities_1_3_cb cb) {
+hardware::Return<void> SampleDriverFull::getCapabilities_1_3(getCapabilities_1_3_cb cb) {
android::nn::initVLogMask();
VLOG(DRIVER) << "getCapabilities_1_3()";
- Capabilities capabilities = {
+ V1_3::Capabilities capabilities = {
.relaxedFloat32toFloat16PerformanceScalar = mPerf,
.relaxedFloat32toFloat16PerformanceTensor = mPerf,
.operandPerformance = nonExtensionOperandPerformance<HalVersion::V1_3>(mPerf),
.ifPerformance = mPerf,
.whilePerformance = mPerf};
- cb(ErrorStatus::NONE, capabilities);
- return Void();
+ cb(V1_3::ErrorStatus::NONE, capabilities);
+ return hardware::Void();
}
-Return<void> SampleDriverFull::getSupportedOperations_1_3(const V1_3::Model& model,
- getSupportedOperations_1_3_cb cb) {
+hardware::Return<void> SampleDriverFull::getSupportedOperations_1_3(
+ const V1_3::Model& model, getSupportedOperations_1_3_cb cb) {
VLOG(DRIVER) << "getSupportedOperations_1_3()";
if (validateModel(model)) {
const size_t count = model.main.operations.size();
std::vector<bool> supported(count, true);
for (size_t i = 0; i < count; i++) {
- const Operation& operation = model.main.operations[i];
+ const V1_3::Operation& operation = model.main.operations[i];
supported[i] = !isExtensionOperationType(operation.type);
}
- cb(ErrorStatus::NONE, supported);
+ cb(V1_3::ErrorStatus::NONE, supported);
} else {
std::vector<bool> supported;
- cb(ErrorStatus::INVALID_ARGUMENT, supported);
+ cb(V1_3::ErrorStatus::INVALID_ARGUMENT, supported);
}
- return Void();
+ return hardware::Void();
}
} // namespace sample_driver