Debug Mode for LibMem Validator - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

The libmem validator supports a debug mode that provides detailed information about the testing process including vector sizes, function names, and the alignment combinations being tested.

Enabling Debug Mode

Use the CMake option to build the validator with debug mode enabled:

# Navigate to your build directory
$ cd /path/to/build/directory

# Configure with debug mode enabled
$ cmake -DLIBMEM_VALIDATOR_DEBUG=ON .

# Build the project
$ make

Disabling Debug Mode

To build the validator without debug output (normal mode):

# Navigate to your build directory
$ cd /path/to/build/directory

# Configure with debug mode disabled
$ cmake -DLIBMEM_VALIDATOR_DEBUG=OFF .

# Build the project
$ make

Debug Output Information

When debug mode is enabled, the validator will output the following information:

  • VEC_SZ: Vector size in bytes (32 for AVX2, 64 for AVX512)

  • Function name: The function being tested

  • Test size: The size parameter being validated

  • Alignment mode: Whether testing single alignment or all alignment combinations

  • Individual alignment tests: Each source/destination alignment combination (when using alignment check mode)

Example Debug Output:

[DEBUG] libmem_validator started
[DEBUG] VEC_SZ = 64 bytes
[DEBUG] Function: memcpy
[DEBUG] Size: 1024
[DEBUG] Alignment check mode: All alignments
[DEBUG] Testing alignment - src: 0, dst: 0
[DEBUG] Testing alignment - src: 0, dst: 1
[DEBUG] Testing alignment - src: 0, dst: 2
...
[DEBUG] Testing alignment - src: 63, dst: 63

Usage Examples:

# Test with debug output enabled - runs for all alignment combinations when last arg is 1
$ ./tools/validator/libmem_validator memcpy 1024 0 0 1

# Test with debug output enabled- runs for specific alignment (src=0, dst=0) when last arg is 0
$ ./tools/validator/libmem_validator memcpy 1024 0 0 0

Note

Debug mode is used only for debugging validator code.