diff options
author | David Gross <dgross@google.com> | 2019-03-18 15:33:53 -0700 |
---|---|---|
committer | David Gross <dgross@google.com> | 2019-03-22 09:22:42 -0700 |
commit | 5dd79af4c786230da13f20606f88927038fd8d76 (patch) | |
tree | b4f3c34b5953bce9f144b665fd4c58976e18b6aa /nn/runtime/test/TestPartitioningRandom.cpp | |
parent | 88b763fdf47a06d5e27f84a435809963c1d318a6 (diff) | |
download | ml-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/TestPartitioningRandom.cpp')
-rw-r--r-- | nn/runtime/test/TestPartitioningRandom.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nn/runtime/test/TestPartitioningRandom.cpp b/nn/runtime/test/TestPartitioningRandom.cpp index 016a840cb..52f0bff33 100644 --- a/nn/runtime/test/TestPartitioningRandom.cpp +++ b/nn/runtime/test/TestPartitioningRandom.cpp @@ -471,12 +471,13 @@ public: TestDriver(const char* name, std::set<Signature> signatures) : SampleDriver(name), mSignatures(std::move(signatures)) { } - 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(); } |