From 19564cb4f77660cdb2f980ca619d4b979b9fe342 Mon Sep 17 00:00:00 2001 From: Boyuan Yang Date: Mon, 27 Nov 2023 22:46:29 -0500 Subject: New upstream version 0.19.0 --- src/dsp/cdef_test.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/dsp/cdef_test.cc') diff --git a/src/dsp/cdef_test.cc b/src/dsp/cdef_test.cc index c25d7df..e2db17a 100644 --- a/src/dsp/cdef_test.cc +++ b/src/dsp/cdef_test.cc @@ -79,11 +79,11 @@ class CdefDirectionTest : public testing::TestWithParam { const char* const test_case = test_info->test_suite_name(); if (absl::StartsWith(test_case, "C/")) { } else if (absl::StartsWith(test_case, "SSE41/")) { + if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!"; CdefInit_SSE4_1(); } else if (absl::StartsWith(test_case, "AVX2/")) { - if ((GetCpuInfo() & kAVX2) != 0) { - CdefInit_AVX2(); - } + if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support!"; + CdefInit_AVX2(); } else if (absl::StartsWith(test_case, "NEON/")) { CdefInit_NEON(); } else { @@ -275,11 +275,11 @@ class CdefFilteringTest : public testing::TestWithParam { } else if (absl::StartsWith(test_case, "NEON/")) { CdefInit_NEON(); } else if (absl::StartsWith(test_case, "SSE41/")) { + if ((GetCpuInfo() & kSSE4_1) == 0) GTEST_SKIP() << "No SSE4.1 support!"; CdefInit_SSE4_1(); } else if (absl::StartsWith(test_case, "AVX2/")) { - if ((GetCpuInfo() & kAVX2) != 0) { - CdefInit_AVX2(); - } + if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support!"; + CdefInit_AVX2(); } else { FAIL() << "Unrecognized architecture prefix in test case name: " << test_case; @@ -304,7 +304,7 @@ template void CdefFilteringTest::TestRandomValues(int num_runs) { const int id = static_cast(param_.rows4x4 < 4) * 3 + (param_.subsampling_x + param_.subsampling_y) * 6; - absl::Duration elapsed_time; + absl::Duration elapsed_time[kMaxPlanes]; for (int num_tests = 0; num_tests < num_runs; ++num_tests) { for (int plane = kPlaneY; plane < kMaxPlanes; ++plane) { const int subsampling_x = (plane == kPlaneY) ? 0 : param_.subsampling_x; @@ -355,7 +355,7 @@ void CdefFilteringTest::TestRandomValues(int num_runs) { source_ + offset, kSourceStride, block_height, primary_strength_, secondary_strength_, damping_, direction_, dest_[plane], kTestBufferStride * sizeof(dest_[0][0])); - elapsed_time += absl::Now() - start; + elapsed_time[plane] += absl::Now() - start; } } @@ -379,7 +379,7 @@ void CdefFilteringTest::TestRandomValues(int num_runs) { ASSERT_NE(expected_digest, nullptr); test_utils::CheckMd5Digest(kCdef, kCdefFilterName, expected_digest, reinterpret_cast(dest_[plane]), - sizeof(dest_[plane]), elapsed_time); + sizeof(dest_[plane]), elapsed_time[plane]); } } -- cgit v1.2.3