FFmpeg
Data Fields
CheckasmConfig Struct Reference

Configuration structure for the checkasm test suite. More...

#include <checkasm.h>

Data Fields

const CheckasmCpuInfocpu_flags
 List of CPU flags understood by the implementation. More...
 
const CheckasmTesttests
 Array of test functions to execute. More...
 
CheckasmCpu cpu
 Detected CPU flags for the current system. More...
 
void(* set_cpu_flags )(CheckasmCpu new_flags)
 Callback invoked when active CPU flags change. More...
 
const char * test_pattern
 Pattern for filtering which tests to run. More...
 
const char * function_pattern
 Pattern for filtering which functions within tests to run. More...
 
int bench
 Enable benchmarking. More...
 
unsigned bench_usec
 Target benchmark duration in microseconds. More...
 
CheckasmFormat format
 Output format for benchmark results. More...
 
int verbose
 Enable verbose output. More...
 
int seed_set
 Enable using the seed value. More...
 
unsigned seed
 Random number generator seed. More...
 
unsigned repeat
 Number of times to repeat tests. More...
 
int cpu_affinity_set
 Enable process pinning via cpu_affinity. More...
 
unsigned cpu_affinity
 CPU core ID for process pinning. More...
 

Detailed Description

Configuration structure for the checkasm test suite.

This structure contains all configuration options for running checkasm tests, including test selection, CPU feature flags, benchmarking options, and output formatting. Initialize this structure with your project's tests and CPU flags before calling checkasm_main() or checkasm_run().

.cpu_flags = my_cpu_flags,
.tests = my_tests,
.cpu = my_get_cpu_flags(),
.set_cpu_flags = my_set_cpu_flags,
};
return checkasm_main(&config, argc, argv);
See also
checkasm_main(), checkasm_run()

Definition at line 158 of file checkasm.h.

Field Documentation

◆ cpu_flags

const CheckasmCpuInfo* CheckasmConfig::cpu_flags

List of CPU flags understood by the implementation.

Array of CPU features that will be tested in incremental order, terminated by an entry with CheckasmCpuInfo.flag == 0 (i.e. {0}).

Each test run inherits any active flags from previously tested CPUs. This allows testing progressively more advanced instruction sets.

Definition at line 168 of file checkasm.h.

Referenced by check_cpu_flag(), checkasm_list_cpu_flags(), checkasm_list_functions(), checkasm_run(), main(), and print_bench_header().

◆ tests

const CheckasmTest* CheckasmConfig::tests

Array of test functions to execute.

Array of test functions to execute, terminated by an entry with CheckasmTest.func == NULL (i.e. {0}.

Definition at line 176 of file checkasm.h.

Referenced by check_cpu_flag(), and print_bench_header().

◆ cpu

CheckasmCpu CheckasmConfig::cpu

Detected CPU flags for the current system.

Set this to the detected CPU capabilities of the system. Any extra flags not included in cpu_flags will also be transparently included in checkasm_get_cpu_flags(), and can be used to signal flags that should be assumed to always be enabled (e.g., CPU_FLAG_FAST_* modifiers).

Definition at line 186 of file checkasm.h.

Referenced by check_cpu_flag(), checkasm_list_cpu_flags(), main(), and print_bench_header().

◆ set_cpu_flags

void(* CheckasmConfig::set_cpu_flags) (CheckasmCpu new_flags)

Callback invoked when active CPU flags change.

If provided, this function will be called whenever the active set of CPU flags changes, with the new set of flags as argument. This includes once at the start of the program with the baseline set of flags.

Use this to update global function pointers, internal static variables, or dispatch tables.

Definition at line 198 of file checkasm.h.

Referenced by check_cpu_flag().

◆ test_pattern

const char* CheckasmConfig::test_pattern

Pattern for filtering which tests to run.

Shell-style wildcard pattern (e.g., "video_*") to select tests. NULL means run all tests.

Definition at line 206 of file checkasm.h.

Referenced by check_cpu_flag(), and print_bench_header().

◆ function_pattern

const char* CheckasmConfig::function_pattern

Pattern for filtering which functions within tests to run.

Shell-style wildcard pattern to select specific functions. Matched against the names passed to checkasm_check_func(). NULL means run all functions.

Definition at line 215 of file checkasm.h.

Referenced by checkasm_check_key(), and print_bench_header().

◆ bench

int CheckasmConfig::bench

Enable benchmarking.

When nonzero, enables performance benchmarking of tested functions. Set to 1 to enable with default settings.

Definition at line 223 of file checkasm.h.

Referenced by check_cpu_flag(), checkasm_bench_func(), checkasm_check_key(), checkasm_report(), checkasm_run(), and print_info().

◆ bench_usec

unsigned CheckasmConfig::bench_usec

Target benchmark duration in microseconds.

Target time (in µs) to spend benchmarking each function. Defaults to 1000 µs if left unset when bench is enabled.

Note
Very slow functions may execute for a longer duration to ensure enough samples are collected for accurate measurement.

Definition at line 234 of file checkasm.h.

Referenced by checkasm_run(), print_bench_header(), and print_info().

◆ format

CheckasmFormat CheckasmConfig::format

Output format for benchmark results.

Definition at line 237 of file checkasm.h.

Referenced by checkasm_run(), print_bench_footer(), print_bench_header(), and print_bench_iter().

◆ verbose

int CheckasmConfig::verbose

Enable verbose output.

When nonzero, prints detailed timing information, failure diagnostics, and extra terminal output (including table headers and extra information about the active configuration).

Definition at line 246 of file checkasm.h.

Referenced by checkasm_report(), fail_internal(), print_bench_footer(), print_bench_header(), print_bench_iter(), and print_info().

◆ seed_set

int CheckasmConfig::seed_set

Enable using the seed value.

If nonzero, the value in the seed field will be used even if it may be zero.

Definition at line 253 of file checkasm.h.

Referenced by checkasm_run().

◆ seed

unsigned CheckasmConfig::seed

Random number generator seed.

If nonzero or if seed_set is nonzero, use this seed for deterministic random number generation. If zero and seed_set is zero, a seed will be chosen based on the current time.

Definition at line 262 of file checkasm.h.

Referenced by check_cpu_flag(), checkasm_check_key(), checkasm_run(), print_bench_header(), and print_info().

◆ repeat

unsigned CheckasmConfig::repeat

Number of times to repeat tests.

Repeat the test (and benchmark, if enabled) this many times using successive seeds. Setting to -1 effectively tests every possible seed (useful for exhaustive testing).

Definition at line 271 of file checkasm.h.

Referenced by checkasm_run(), and print_bench_header().

◆ cpu_affinity_set

int CheckasmConfig::cpu_affinity_set

Enable process pinning via cpu_affinity.

If nonzero, the test process will be pinned to the CPU core specified in cpu_affinity.

Warning
This will override the CPU affinity of the calling process, and will persist even after checkasm_run() returns.

Definition at line 281 of file checkasm.h.

Referenced by checkasm_run(), and print_bench_header().

◆ cpu_affinity

unsigned CheckasmConfig::cpu_affinity

CPU core ID for process pinning.

If cpu_affinity_set is nonzero, pin the test process to this CPU core.

Definition at line 288 of file checkasm.h.

Referenced by checkasm_run(), and print_bench_header().


The documentation for this struct was generated from the following file:
tf_sess_config.config
config
Definition: tf_sess_config.py:33
checkasm_main
CHECKASM_API int checkasm_main(CheckasmConfig *config, int argc, const char *argv[])
Main entry point for checkasm test programs.
Definition: checkasm.c:1142
CheckasmConfig
Configuration structure for the checkasm test suite.
Definition: checkasm.h:158