summaryrefslogtreecommitdiff
path: root/nn/runtime/test/TestCompilationCaching.cpp
diff options
context:
space:
mode:
authorDavid Gross <dgross@google.com>2019-03-18 15:33:53 -0700
committerDavid Gross <dgross@google.com>2019-03-22 09:22:42 -0700
commit5dd79af4c786230da13f20606f88927038fd8d76 (patch)
treeb4f3c34b5953bce9f144b665fd4c58976e18b6aa /nn/runtime/test/TestCompilationCaching.cpp
parent88b763fdf47a06d5e27f84a435809963c1d318a6 (diff)
downloadml-5dd79af4c786230da13f20606f88927038fd8d76.tar.gz
Add @V1_2::Capabilities to support all non extension operand types.
Performance information in Capabilities is used by the runtime when it selects the appropriate processor to distribute work to. Prior to this CL, Capabilities can only distinguish between float and non-float data types -- so, for example, float16 and float32 performance is considered to be the same, and performance for all non-float data types is considered to be the same. Also: - tweak some diagnostics - fix bug in ::android::nn::wrapper::OperandType and ::android::nn::extension_wrapper::OperandType copy constructor and assignment operator Bug: 124041010 Test: NeuralNetworksTest_static Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all Change-Id: If3290542020ac1862bcd94bf3acddbc2e50109a6 Merged-In: If3290542020ac1862bcd94bf3acddbc2e50109a6 (cherry picked from commit cfed5dc7266565f24c9bfd52bb8b86933852d536)
Diffstat (limited to 'nn/runtime/test/TestCompilationCaching.cpp')
-rw-r--r--nn/runtime/test/TestCompilationCaching.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/nn/runtime/test/TestCompilationCaching.cpp b/nn/runtime/test/TestCompilationCaching.cpp
index 604be4961..18c37f249 100644
--- a/nn/runtime/test/TestCompilationCaching.cpp
+++ b/nn/runtime/test/TestCompilationCaching.cpp
@@ -112,9 +112,14 @@ class CachingDriver : public sample_driver::SampleDriver {
}
// Reports faster than cpu.
- Return<void> getCapabilities_1_1(getCapabilities_1_1_cb cb) override {
- cb(ErrorStatus::NONE, {.float32Performance = {.execTime = 0.1, .powerUsage = 0.1},
- .quantized8Performance = {.execTime = 0.1, .powerUsage = 0.1}});
+ Return<void> getCapabilities_1_2(getCapabilities_1_2_cb cb) override {
+ android::nn::initVLogMask();
+ const PerformanceInfo kPerf = {.execTime = 0.1, .powerUsage = 0.1};
+ Capabilities capabilities = {
+ .relaxedFloat32toFloat16PerformanceScalar = kPerf,
+ .relaxedFloat32toFloat16PerformanceTensor = kPerf,
+ .operandPerformance = android::nn::nonExtensionOperandPerformance(kPerf)};
+ cb(ErrorStatus::NONE, capabilities);
return Void();
}