17.3.2. Performance Benchmarking on Linux - 5.2 English - 57404

AOCL User Guide (57404)

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

The AOCL-Sparse benchmark executable (called aoclsparse-bench) accepts various input parameters including matrix data and triggers the desired operation while measuring the API performance.

Optionally, it can also check the results against its reference implementation. The matrix data can be randomly generated or read from the Matrix Market format (mtx) input file. The MTX inputs can be downloaded from the SuiteSprase Matrix Collection website (https://sparse.tamu.edu/). Usage of both the input types is as follows:

  1. Enable BUILD_CLIENTS_BENCHMARKS during AOCL-Sparse installation process (refer to Building from Source on Linux).

  2. Export paths to the dependent libraries in LD_LIBRARY_PATH if building shared library of AOCL-Sparse:

    $ export AOCL_ROOT=/opt/aocl
    $ export SPARSE_ROOT=<aoclsparse_install_path>
    $ export LD_LIBRARY_PATH=$AOCL_ROOT/lib_ILP64:$LD_LIBRARY_PATH
    $ export LD_LIBRARY_PATH=$SPARSE_ROOT/lib:$LD_LIBRARY_PATH
    
  3. Navigate to the folder containing the AOCL-Sparse executable:

    $ cd out_sparse/tests/staging/
    
  4. Run the benchmark:

    **Random Data:**
    
    $ ./aoclsparse-bench --function=optmv --precision=d --sizem=1000
    --sizen=1000 --sizennz=4000 - verify=1
    
    **MTX Input:**
    
    $ ./aoclsparse-bench --function=optmv --precision=d --mtx=LFAT5.mtx
    --verify=1
    
  5. Run the multi-threaded (4 threads) CSR-SPMV on a randomly generated matrix:

    $ export AOCLSPARSE_NUM_THREADS=4
    
    $ ./aoclsparse-bench --function=csrmv --precision=d --sizem=1000
    --sizen=1000 --sizennz=4000 -- verify=1
    

Note

Running aoclsparse-bench without any arguments will provide overview of its parameters.