mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-01-01 03:12:16 +08:00
unittest fix for cpu flags.
cpu flags of 1 disables SIMD and uses C. This used to be 0, but the change in auto init behavior means that 0 now means uninitialized, and will cause auto detect to reinit the cpu info. A value of 1 disables the auto init. TBR=harryjin@google.com BUG=none Review URL: https://codereview.chromium.org/1408753004 .
This commit is contained in:
parent
ab9a42d982
commit
82d74a37fa
@ -36,7 +36,7 @@ DEFINE_int32(libyuv_cpu_info, -1,
|
||||
|
||||
LibYUVConvertTest::LibYUVConvertTest() :
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(130),
|
||||
benchmark_height_(72), disable_cpu_flags_(0), benchmark_cpu_info_(-1) {
|
||||
benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
@ -88,7 +88,7 @@ LibYUVConvertTest::LibYUVConvertTest() :
|
||||
|
||||
LibYUVColorTest::LibYUVColorTest() :
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
|
||||
benchmark_height_(72), disable_cpu_flags_(0), benchmark_cpu_info_(-1) {
|
||||
benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
@ -140,7 +140,7 @@ LibYUVColorTest::LibYUVColorTest() :
|
||||
|
||||
LibYUVScaleTest::LibYUVScaleTest() :
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
|
||||
benchmark_height_(72), disable_cpu_flags_(0), benchmark_cpu_info_(-1) {
|
||||
benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
@ -192,7 +192,7 @@ LibYUVScaleTest::LibYUVScaleTest() :
|
||||
|
||||
LibYUVRotateTest::LibYUVRotateTest() :
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
|
||||
benchmark_height_(72), disable_cpu_flags_(0), benchmark_cpu_info_(-1) {
|
||||
benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
@ -244,7 +244,7 @@ LibYUVRotateTest::LibYUVRotateTest() :
|
||||
|
||||
LibYUVPlanarTest::LibYUVPlanarTest() :
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
|
||||
benchmark_height_(72), disable_cpu_flags_(0), benchmark_cpu_info_(-1) {
|
||||
benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
@ -296,7 +296,7 @@ LibYUVPlanarTest::LibYUVPlanarTest() :
|
||||
|
||||
LibYUVBaseTest::LibYUVBaseTest() :
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
|
||||
benchmark_height_(72), disable_cpu_flags_(0), benchmark_cpu_info_(-1) {
|
||||
benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
|
||||
@ -81,7 +81,7 @@ class LibYUVColorTest : public ::testing::Test {
|
||||
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
|
||||
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
|
||||
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
|
||||
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
|
||||
int disable_cpu_flags_; // Default 1. Use -1 for benchmarking.
|
||||
int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD.
|
||||
};
|
||||
|
||||
@ -94,7 +94,7 @@ class LibYUVConvertTest : public ::testing::Test {
|
||||
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
|
||||
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
|
||||
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
|
||||
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
|
||||
int disable_cpu_flags_; // Default 1. Use -1 for benchmarking.
|
||||
int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD.
|
||||
};
|
||||
|
||||
@ -107,7 +107,7 @@ class LibYUVScaleTest : public ::testing::Test {
|
||||
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
|
||||
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
|
||||
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
|
||||
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
|
||||
int disable_cpu_flags_; // Default 1. Use -1 for benchmarking.
|
||||
int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD.
|
||||
};
|
||||
|
||||
@ -120,7 +120,7 @@ class LibYUVRotateTest : public ::testing::Test {
|
||||
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
|
||||
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
|
||||
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
|
||||
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
|
||||
int disable_cpu_flags_; // Default 1. Use -1 for benchmarking.
|
||||
int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD.
|
||||
};
|
||||
|
||||
@ -133,7 +133,7 @@ class LibYUVPlanarTest : public ::testing::Test {
|
||||
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
|
||||
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
|
||||
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
|
||||
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
|
||||
int disable_cpu_flags_; // Default 1. Use -1 for benchmarking.
|
||||
int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD.
|
||||
};
|
||||
|
||||
@ -146,7 +146,7 @@ class LibYUVBaseTest : public ::testing::Test {
|
||||
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
|
||||
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
|
||||
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
|
||||
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
|
||||
int disable_cpu_flags_; // Default 1. Use -1 for benchmarking.
|
||||
int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD.
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user