12.3.1. Using Test Suite - 12.3.1. Using Test Suite - 5.3 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2026-05-13
Version
5.3 English

AOCL-LibM includes comprehensive test suites that validate the correctness and accuracy of the mathematical functions. The test suite covers: - Unit tests for all scalar functions - Vector function validation tests - Accuracy tests comparing against reference implementations - Corner case and special value testing - Performance and conformance tests

To run the test suite:

Using CMake:

For detailed instructions, refer to aocl-libm-ose/docs/CMakeBuildSystem.md.

To build all the APIs for testing:

$ cmake --build --preset dev-release-gcc --target gtests

To build and test a single API, use the specific target name:

$ cmake --build --preset dev-release-gcc --target test_<function>

Using SCons:

For detailed instructions, refer to aocl-libm-ose/BUILDING.txt.

$ cd aocl-libm-ose
$ scons <other options> gtests

Run the test executable for the required function:

$ ./build/aocl-release/gtests/<function>/test_<function> [test parameters]

Example:

$ ./build/aocl-release/gtests/exp/test_exp

Test Parameters:

  • Input type: -i (f for single precision, d for double precision)

  • Vector input count: -e (1 for scalar variants; for vector variants: 4/8/16 for single precision, 2/4/8 for double precision; 32 for vector array variants)

  • Test Type: -t (perf for performance, conf for conformance, accu for accuracy, inplace for inplace)

  • Input count: -c (Integer value for number of inputs)

  • Input range: -r (provide range: start,stop,step size. Example: -r -50,50,SIMPLE)

  • Number type: -z (c for complex variant function, default is real variant function)

Note

-t inplace

is used for in-place buffer testing (where the same buffer is used for both input and output arrays). This option is applicable only for accuracy and memory testing of vector array (vrda, vrsa) variants.