aboutsummaryrefslogtreecommitdiff
path: root/unit_test/unit_test.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2016-06-08 10:38:09 -0700
committerFrank Barchard <fbarchard@google.com>2016-06-08 10:38:09 -0700
commite2611a734955782ac9be1a64d080a6e52a57be82 (patch)
treeb9afc4382e0b00507da3c3e0fbc8b184c2e8bf56 /unit_test/unit_test.cc
parent026be3cd850d086dc24a792ae4f777e2b83533b7 (diff)
downloadlibyuv-e2611a734955782ac9be1a64d080a6e52a57be82.tar.gz
document cpuid command line behavior
cpu_info_ is zero for uninitialized state and all bits are off, disabling all cpu optimizations. the 1 bit indicates cpu_info_ is initialized avoiding calling the detection code again for performance. MaskCpuFlags initializes the cpu ignoring existing flags, then masks with the supplied flags and stores to cpu_info_. As a mask, -1 has no effect, enabling all cpu features that were detected, but nothing that wasnt detected. Setting to 0 will cause the next call to re-initialize the cpu, which is same as enabling all features. Setting mask to 1 will turn off all cpu features but keep the initialized bit on, so the next detection call wont reinitialize and the cpu features are all disabled. So normal behavior for command line and programatic masking is: 1 = C -1 = SIMD TBR=harryjin@google.com BUG=libyuv:600 TESTED=out64/Release/bin/run_libyuv_unittest -s libyuv_unittest --verbose --release --gtest_filter=*ARGBExtractAlpha* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=9999 --libyuv_flags=1 --libyuv_cpu_info=1" Review URL: https://codereview.chromium.org/2042933002 .
Diffstat (limited to 'unit_test/unit_test.cc')
-rw-r--r--unit_test/unit_test.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc
index 95398285..e75510fd 100644
--- a/unit_test/unit_test.cc
+++ b/unit_test/unit_test.cc
@@ -25,9 +25,10 @@ unsigned int fastrand_seed = 0xfb;
DEFINE_int32(libyuv_width, 0, "width of test image.");
DEFINE_int32(libyuv_height, 0, "height of test image.");
DEFINE_int32(libyuv_repeat, 0, "number of times to repeat test.");
-DEFINE_int32(libyuv_flags, 0, "cpu flags for reference code. 0 = C -1 = asm");
-DEFINE_int32(libyuv_cpu_info, -1,
- "cpu flags for benchmark code. -1 = SIMD, 1 = C");
+DEFINE_int32(libyuv_flags, 0,
+ "cpu flags for reference code. 1 = C, -1 = SIMD");
+DEFINE_int32(libyuv_cpu_info, 0,
+ "cpu flags for benchmark code. 1 = C, -1 = SIMD");
// For quicker unittests, default is 128 x 72. But when benchmarking,
// default to 720p. Allow size to specify.