Skip to content

Running

Nico edited this page Jul 21, 2019 · 3 revisions

Notice

Before reading this Wiki, it is assumed rocSPARSE with the client applications has been successfully built as described in Build rocSPARSE libraries and verification code

Samples

cd [BUILD_DIR]/clients/staging
./example-csrmv 1000

Example code that calls rocSPARSE csrmv routine.

Unit tests

Run tests with the following:

cd [BUILD_DIR]/clients/staging
./rocsparse-test

To run specific tests, use --gtest_filter=match where match is a ':'-separated list of wildcard patterns (called the positive patterns) optionally followed by a '-' and another ':'-separated pattern list (called the negative patterns). For example, run coo2csr tests with the following commands:

cd [BUILD_DIR]/clients/staging
./rocsparse-test --gtest_filter=*coo2csr*

Benchmarks

Run benchmarks with the following commands:

cd [BUILD_DIR]/clients/staging
./rocsparse-bench -h

The following are examples for running particular csrsort and ellmv benchmark:

./rocsparse-bench -f csrsort -r s -m 1000 -n 1000 -i 50
./rocsparse-bench -f ellmv --laplacian-dim 1000 -r s -i 50 --alpha 1.3

Logging

Three environment variables can be set to enable logging:

  1. ROCSPARSE_LAYER
  2. ROCSPARSE_LOG_TRACE_PATH
  3. ROCSPARSE_LOG_BENCH_PATH

ROCSPARSE_LAYER is a bit mask as follows:

  • if ROCSPARSE_LAYER is not set, there is no logging
  • if ROCSPARSE_LAYER is set to 1, then there is trace logging
  • if ROCSPARSE_LAYER is set to 2, then there is bench logging
  • if ROCSPARSE_LAYER is set to 3, then there is both trace and bench logging

Trace logging outputs a line each time a rocSPARSE function is called, the line contains the function name and the values of arguments.

Bench logging outputs a line each time a rocSPARSE function is called. The line can be used with the executable rocsparse-bench to call the function with the same arguments.

Note that performance will degrade when logging is enabled. The default is the environment variable ROCSPARSE_LAYER unset, and no logging.

The default stream for logging output is standard error. If the user sets the environment variable ROCSPARSE_LOG_TRACE_PATH to the full path name for a file, the file is opened, and trace logging is streamed to that file. If the environment variable ROCSPARSE_LOG_BENCH_PATH is set to the full path name for a file, the file is opened, and bench logging is streamed to that file. If either the trace logging or bench logging file cannot be opened, logging output is streamed to standard error.

Clone this wiki locally