Internal functions and structures not part of the public API.
More...
|
| #define | checkasm_clear_cpu_state() |
| | Clear CPU state after running a function. More...
|
| |
| #define | CHECKASM_PERF_CALL4(...) |
| |
| #define | CHECKASM_PERF_CALL16(...) |
| |
| #define | CHECKASM_PERF_BENCH_SIMPLE(count, time, ...) |
| |
| #define | CHECKASM_PERF_BENCH_ASM(total_count, time, ...) |
| |
| #define | CHECKASM_PERF_BENCH(count, time, ...) |
| |
| #define | DECL_CHECK_FUNC(NAME, TYPE) |
| |
| #define | DECL_CHECKASM_CHECK_FUNC(type) CHECKASM_API DECL_CHECK_FUNC(checkasm_check_impl_##type, type) |
| |
| #define | checkasm_check_impl2(type) checkasm_check_impl_##type |
| |
| #define | checkasm_check_impl(type) checkasm_check_impl2(type) |
| |
| #define | checkasm_check1(type, ...) checkasm_check_impl_##type(__VA_ARGS__) |
| |
| #define | checkasm_check2(type, ...) checkasm_check1(type, __FILE__, __LINE__, __VA_ARGS__) |
| |
|
| CHECKASM_API void | checkasm_set_signal_handler_state (int enabled) |
| | Enable or disable signal handling. More...
|
| |
| CHECKASM_API void | checkasm_push_stack_guard (uintptr_t guard[2]) |
| | Push stack guard values for corruption detection. More...
|
| |
| CHECKASM_API void | checkasm_pop_stack_guard (void) |
| |
| const CHECKASM_API CheckasmPerf * | checkasm_get_perf (void) |
| |
| CHECKASM_API int | checkasm_bench_func (void) |
| | Check if current function should be benchmarked. More...
|
| |
| CHECKASM_API int | checkasm_bench_runs (void) |
| | Get number of iterations for current benchmark run. More...
|
| |
| CHECKASM_API void | checkasm_bench_update (int iterations, uint64_t cycles) |
| | Update benchmark statistics with timing results. More...
|
| |
| CHECKASM_API void | checkasm_bench_finish (void) |
| | Finalize and store benchmark results. More...
|
| |
| static void | checkasm_unused (void) |
| | Suppress unused variable warnings. More...
|
| |
| | DECL_CHECKASM_CHECK_FUNC (int) |
| |
| | DECL_CHECKASM_CHECK_FUNC (int8_t) |
| |
| | DECL_CHECKASM_CHECK_FUNC (int16_t) |
| |
| | DECL_CHECKASM_CHECK_FUNC (int32_t) |
| |
| | DECL_CHECKASM_CHECK_FUNC (unsigned) |
| |
| | DECL_CHECKASM_CHECK_FUNC (uint8_t) |
| |
| | DECL_CHECKASM_CHECK_FUNC (uint16_t) |
| |
| | DECL_CHECKASM_CHECK_FUNC (uint32_t) |
| |
| CHECKASM_API int | checkasm_check_impl_float_ulp (const char *file, int line, const float *buf1, ptrdiff_t stride1, const float *buf2, ptrdiff_t stride2, int w, int h, const char *name, unsigned max_ulp, int align_w, int align_h, int padding) |
| | Compare float buffers with ULP tolerance. More...
|
| |
Internal functions and structures not part of the public API.
These functions and types are used internally by checkasm macros and should not be called or referenced directly by test code.
◆ checkasm_clear_cpu_state
| #define checkasm_clear_cpu_state |
( |
| ) |
|
Value:
Clear CPU state after running a function.
Clears any processor state that might be left over after running a function. On x86, this typically includes running EMMS to clear MMX state.
Definition at line 522 of file test.h.
◆ CHECKASM_PERF_CALL4
| #define CHECKASM_PERF_CALL4 |
( |
|
... | ) |
|
Value: do { \
int tidx = 0; \
bench_func(__VA_ARGS__); \
tidx = 1; \
bench_func(__VA_ARGS__); \
tidx = 2; \
bench_func(__VA_ARGS__); \
tidx = 3; \
bench_func(__VA_ARGS__); \
(void) tidx; \
} while (0)
Definition at line 554 of file test.h.
◆ CHECKASM_PERF_CALL16
| #define CHECKASM_PERF_CALL16 |
( |
|
... | ) |
|
Value: do { \
CHECKASM_PERF_CALL4(__VA_ARGS__); \
CHECKASM_PERF_CALL4(__VA_ARGS__); \
CHECKASM_PERF_CALL4(__VA_ARGS__); \
CHECKASM_PERF_CALL4(__VA_ARGS__); \
} while (0)
Definition at line 567 of file test.h.
◆ CHECKASM_PERF_BENCH_SIMPLE
| #define CHECKASM_PERF_BENCH_SIMPLE |
( |
|
count, |
|
|
|
time, |
|
|
|
... |
|
) |
| |
Value: do { \
time = perf.start(); \
for (int tidx = 0; tidx < count; tidx++) \
bench_func(__VA_ARGS__); \
time = perf.stop(time); \
} while (0)
Definition at line 577 of file test.h.
◆ CHECKASM_PERF_BENCH_ASM
| #define CHECKASM_PERF_BENCH_ASM |
( |
|
total_count, |
|
|
|
time, |
|
|
|
... |
|
) |
| |
Value: do { \
int tcount_trim = 0; \
uint64_t tsum_trim = 0; \
for (int titer = 0; titer < total_count; titer += 32) { \
CHECKASM_PERF_CALL16(__VA_ARGS__); \
CHECKASM_PERF_CALL16(__VA_ARGS__); \
if (t * tcount_trim <= tsum_trim * 4 && (titer > 0 || total_count < 1000)) { \
tsum_trim += t; \
tcount_trim++; \
} \
} \
time = tsum_trim; \
total_count = tcount_trim << 5; \
} while (0)
Definition at line 586 of file test.h.
◆ CHECKASM_PERF_BENCH
| #define CHECKASM_PERF_BENCH |
( |
|
count, |
|
|
|
time, |
|
|
|
... |
|
) |
| |
Value: do { \
CHECKASM_PERF_BENCH_SIMPLE(count, time, __VA_ARGS__); \
} while (0)
Definition at line 621 of file test.h.
◆ DECL_CHECK_FUNC
| #define DECL_CHECK_FUNC |
( |
|
NAME, |
|
|
|
TYPE |
|
) |
| |
Value: int (NAME)(
const char *
const file,
const int line,
const TYPE *
const buf1, \
const ptrdiff_t stride1,
const TYPE *
const buf2,
const ptrdiff_t stride2, \
const
int w,
const int h,
const char *
const buf_name,
const int align_w, \
const int align_h, const int padding)
Definition at line 416 of file utils.h.
◆ DECL_CHECKASM_CHECK_FUNC
◆ checkasm_check_impl2
| #define checkasm_check_impl2 |
( |
|
type | ) |
checkasm_check_impl_##type |
◆ checkasm_check_impl
◆ checkasm_check1
| #define checkasm_check1 |
( |
|
type, |
|
|
|
... |
|
) |
| checkasm_check_impl_##type(__VA_ARGS__) |
◆ checkasm_check2
◆ checkasm_set_signal_handler_state()
| CHECKASM_API void checkasm_set_signal_handler_state |
( |
int |
enabled | ) |
|
Enable or disable signal handling.
- Parameters
-
| [in] | enabled | Non-zero to enable signal handling, 0 to disable |
Definition at line 52 of file signal.c.
Referenced by checkasm_perf_init().
◆ checkasm_push_stack_guard()
| CHECKASM_API void checkasm_push_stack_guard |
( |
uintptr_t |
guard[2] | ) |
|
◆ checkasm_pop_stack_guard()
◆ checkasm_get_perf()
◆ checkasm_bench_func()
Check if current function should be benchmarked.
- Returns
- Non-zero if benchmarking is enabled for the current function
Definition at line 449 of file checkasm.c.
◆ checkasm_bench_runs()
Get number of iterations for current benchmark run.
- Returns
- Number of iterations to run, or 0 if benchmarking is complete
Definition at line 454 of file checkasm.c.
◆ checkasm_bench_update()
| CHECKASM_API void checkasm_bench_update |
( |
int |
iterations, |
|
|
uint64_t |
cycles |
|
) |
| |
Update benchmark statistics with timing results.
- Parameters
-
| [in] | iterations | Number of iterations that were run |
| [in] | cycles | Sum of elapsed time/cycles for those iterations |
Definition at line 472 of file checkasm.c.
◆ checkasm_bench_finish()
Finalize and store benchmark results.
Definition at line 486 of file checkasm.c.
◆ checkasm_unused()
| static void checkasm_unused |
( |
void |
| ) |
|
|
inlinestatic |
Suppress unused variable warnings.
Definition at line 655 of file test.h.
◆ DECL_CHECKASM_CHECK_FUNC() [1/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
int |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [2/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
int8_t |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [3/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
int16_t |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [4/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
int32_t |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [5/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
unsigned |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [6/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
uint8_t |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [7/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
uint16_t |
| ) |
|
◆ DECL_CHECKASM_CHECK_FUNC() [8/8]
| DECL_CHECKASM_CHECK_FUNC |
( |
uint32_t |
| ) |
|
◆ checkasm_check_impl_float_ulp()
| CHECKASM_API int checkasm_check_impl_float_ulp |
( |
const char * |
file, |
|
|
int |
line, |
|
|
const float * |
buf1, |
|
|
ptrdiff_t |
stride1, |
|
|
const float * |
buf2, |
|
|
ptrdiff_t |
stride2, |
|
|
int |
w, |
|
|
int |
h, |
|
|
const char * |
name, |
|
|
unsigned |
max_ulp, |
|
|
int |
align_w, |
|
|
int |
align_h, |
|
|
int |
padding |
|
) |
| |
Compare float buffers with ULP tolerance.
Definition at line 701 of file utils.c.