diff options
author | I-Jui (Ray) Sung <ijsung@google.com> | 2017-09-11 00:54:46 -0700 |
---|---|---|
committer | Ray Sung <ijsung@google.com> | 2017-09-13 08:01:38 +0000 |
commit | 420cf7bdb689bc53b2a4e8c5f9eca42f7a06c1c0 (patch) | |
tree | 19a07a6464d8d9c8ff0223a12197b109fec2a8ff /nn/runtime/test/TestGenerated.cpp | |
parent | a0e96dd687a3b06263d380c0d74293c93eb712ef (diff) | |
download | ml-420cf7bdb689bc53b2a4e8c5f9eca42f7a06c1c0.tar.gz |
Generated VTS tests and minor tweak on test harness
Changes:
- Export generated models and examples path in Android.bp
- Avoid duplicated definitions in TestHarness.h when included multiple
times
- Add generated VTS models for VTS
- Update test generator to compute scale and offset from fmin and fmax
Bug: 63905942
Test: VTS and CTS unit testcases with sample driver enabled on Angler
Change-Id: I3e7c5a2aa2c9945e7cd8cdf93968ef88f2b3bbfa
Diffstat (limited to 'nn/runtime/test/TestGenerated.cpp')
-rw-r--r-- | nn/runtime/test/TestGenerated.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nn/runtime/test/TestGenerated.cpp b/nn/runtime/test/TestGenerated.cpp index cd5c5ec39..cbc647035 100644 --- a/nn/runtime/test/TestGenerated.cpp +++ b/nn/runtime/test/TestGenerated.cpp @@ -121,13 +121,14 @@ class Example { resize_accordingly<float>(golden, test); resize_accordingly<int32_t>(golden, test); resize_accordingly<uint8_t>(golden, test); - for_all(test, [&request](int idx, auto p, auto s) { + for_all(test, [&request](int idx, void* p, auto s) { ASSERT_EQ(Result::NO_ERROR, request.setOutput(idx, p, s)); }); Result r = request.compute(); ASSERT_EQ(Result::NO_ERROR, r); - +#define USE_EXPECT_FLOAT_EQ 1 +#ifdef USE_EXPECT_FLOAT_EQ // We want "close-enough" results for float for (auto& i : std::get<Float32Operands>(golden)) { int idx = i.first; @@ -139,7 +140,10 @@ class Example { EXPECT_FLOAT_EQ(golden_float[i], test_float[i]); } } - +#else // Use EXPECT_EQ instead; nicer error reporting + EXPECT_EQ(std::get<Float32Operands>(golden), + std::get<Float32Operands>(test)); +#endif EXPECT_EQ(std::get<Int32Operands>(golden), std::get<Int32Operands>(test)); EXPECT_EQ(std::get<Quant8Operands>(golden), |