diff options
author | Michael Butler <butlermichael@google.com> | 2020-06-09 12:57:28 -0700 |
---|---|---|
committer | Michael Butler <butlermichael@google.com> | 2020-06-15 16:21:07 -0700 |
commit | c8d7fc69a952a72ce1f97bb2f5b580d21861579f (patch) | |
tree | 813c448d2fbb6844fc9f576a3db36e3ed1d6b38a | |
parent | 00cf2e729bd329b31dfdc6eff888a09544e3a975 (diff) | |
download | ml-c8d7fc69a952a72ce1f97bb2f5b580d21861579f.tar.gz |
Change TEST_MAPPING configuration of NeuralNetworksTest_static
This change restricts presubmit to only run a single pass of
NeuralNetworksTest_static ("pass 10"), corresponding to:
* useCpuOnly = 0
* computeMode = ComputeMode::ASYNC
* allowSyncExecHal = 1
Bug: 131770421
Test: mma
Test: atest
Change-Id: Ifd316ea87151ae80001208a38cb7af321f7cf9ec
Merged-In: Ifd316ea87151ae80001208a38cb7af321f7cf9ec
(cherry picked from commit 77d9d6b9921bea2918403751820638c19ff0bd37)
-rw-r--r-- | nn/TEST_MAPPING | 12 | ||||
-rw-r--r-- | nn/runtime/test/TestMain.cpp | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/nn/TEST_MAPPING b/nn/TEST_MAPPING index f3eaa9940..74ff411c0 100644 --- a/nn/TEST_MAPPING +++ b/nn/TEST_MAPPING @@ -15,6 +15,18 @@ { // b/153876253, temporarily filter out failing l2_norm tests "include-filter": "-*l2_normalization_axis_corner_case*" + }, + { + // Restrict NeuralNetworksTest_static to run only a single + // pass consisting of: + // * useCpuOnly = 0 + // * computeMode = ComputeMode::ASYNC + // * allowSyncExecHal = 1 + // + // The value here is a bitmask indicating only "pass 10" + // should be run (1024 = 2^10). The bit conversions can be + // found in frameworks/ml/nn/runtime/test/TestMain.cpp. + "native-test-flag": "1024" } ] }, diff --git a/nn/runtime/test/TestMain.cpp b/nn/runtime/test/TestMain.cpp index a4fefae70..f89c7adbc 100644 --- a/nn/runtime/test/TestMain.cpp +++ b/nn/runtime/test/TestMain.cpp @@ -56,6 +56,11 @@ static uint64_t allowedPasses = ~uint64_t(0); // true, and if we are asked to set it to false, we return 0 ("success") without // running tests. static int test(bool useCpuOnly, Execution::ComputeMode computeMode, bool allowSyncExecHal = true) { + // NOTE: The test mapping configuration (frameworks/ml/nn/TEST_MAPPING) uses + // the value of 1024 to only run pass 10 of the test, corresponding to + // "useCpuOnly = 0, computeMode = ComputeMode::ASYNC, allowSyncExecHal = 1". + // If you change the bit representation here, also make the corresponding + // change to the TEST_MAPPING file to run the equivalent pass of the test. uint32_t passIndex = (useCpuOnly << 0) + (static_cast<uint32_t>(computeMode) << 1) + (allowSyncExecHal << 3); |