summaryrefslogtreecommitdiff
path: root/nn/runtime/test/TestExecution.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-21 22:42:35 -0700
commitcfed5dc7266565f24c9bfd52bb8b86933852d536 (patch)
tree6a63f73770aa19fedfb1ed4b798b2a5de03a2692 /nn/runtime/test/TestExecution.cpp
parentf3833a30f36d6d4cceaf1649b8794b6e06398676 (diff)
downloadml-cfed5dc7266565f24c9bfd52bb8b86933852d536.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
Diffstat (limited to 'nn/runtime/test/TestExecution.cpp')
-rw-r--r--nn/runtime/test/TestExecution.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/nn/runtime/test/TestExecution.cpp b/nn/runtime/test/TestExecution.cpp
index 168c15cdb..a56a7e737 100644
--- a/nn/runtime/test/TestExecution.cpp
+++ b/nn/runtime/test/TestExecution.cpp
@@ -158,12 +158,13 @@ class TestDriver12 : public SampleDriver {
TestDriver12(const std::string& name, ErrorStatus errorStatus)
: SampleDriver(name.c_str()), mErrorStatus(errorStatus) {}
- Return<void> getCapabilities_1_1(getCapabilities_1_1_cb _hidl_cb) override {
+ Return<void> getCapabilities_1_2(getCapabilities_1_2_cb _hidl_cb) override {
android::nn::initVLogMask();
- Capabilities capabilities =
- {.float32Performance = {.execTime = 0.75f, .powerUsage = 0.75f},
- .quantized8Performance = {.execTime = 0.75f, .powerUsage = 0.75f},
- .relaxedFloat32toFloat16Performance = {.execTime = 0.75f, .powerUsage = 0.75f}};
+ const PerformanceInfo kPerf = {.execTime = 0.75f, .powerUsage = 0.75f};
+ Capabilities capabilities = {
+ .relaxedFloat32toFloat16PerformanceScalar = kPerf,
+ .relaxedFloat32toFloat16PerformanceTensor = kPerf,
+ .operandPerformance = nn::nonExtensionOperandPerformance(kPerf)};
_hidl_cb(ErrorStatus::NONE, capabilities);
return Void();
}