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:
Enable
BUILD_CLIENTS_BENCHMARKSduring AOCL-Sparse installation process (refer to Building from Source on Linux).Export paths to the dependent libraries in
LD_LIBRARY_PATHif 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
Navigate to the folder containing the AOCL-Sparse executable:
$ cd out_sparse/tests/staging/
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
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.