Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fd50049 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4386596 from e5e339d2 to oc-mr1-release

Change-Id: Id2551559c381d67cba9357665497f5e58560e592
parents eb92c84f e5e339d2
Loading
Loading
Loading
Loading
+5 −7
Original line number Original line Diff line number Diff line
@@ -46,11 +46,11 @@ using ::generated_tests::Int32Operands;
using ::generated_tests::Quant8Operands;
using ::generated_tests::Quant8Operands;
using ::generated_tests::compare;
using ::generated_tests::compare;


template <typename ty>
template <typename T>
void copy_back_(MixedTyped* dst, const std::vector<RequestArgument>& ra, char* src) {
void copy_back_(MixedTyped* dst, const std::vector<RequestArgument>& ra, char* src) {
    MixedTyped& test = *dst;
    MixedTyped& test = *dst;
    for_each(test, [&ra, src](int index, std::vector<ty>& m) {
    for_each<T>(test, [&ra, src](int index, std::vector<T>& m) {
        ASSERT_EQ(m.size(), ra[index].location.length / sizeof(ty));
        ASSERT_EQ(m.size(), ra[index].location.length / sizeof(T));
        char* begin = src + ra[index].location.offset;
        char* begin = src + ra[index].location.offset;
        memcpy(m.data(), begin, ra[index].location.length);
        memcpy(m.data(), begin, ra[index].location.length);
    });
    });
@@ -213,10 +213,8 @@ void Execute(const sp<IDevice>& device, std::function<Model(void)> create_model,
        copy_back(&test, outputs_info, outputPtr);
        copy_back(&test, outputs_info, outputPtr);
        outputMemory->commit();
        outputMemory->commit();
        // Filter out don't cares
        // Filter out don't cares
        MixedTyped filtered_golden;
        MixedTyped filtered_golden = filter(golden, is_ignored);
        MixedTyped filtered_test;
        MixedTyped filtered_test = filter(test, is_ignored);
        filter(golden, &filtered_golden, is_ignored);
        filter(test, &filtered_test, is_ignored);


        // We want "close-enough" results for float
        // We want "close-enough" results for float
        compare(filtered_golden, filtered_test);
        compare(filtered_golden, filtered_test);