Install Primbench

Install Primbench#

Primbench is a single-header library. No build step, package installation, or linking against a Primbench binary is required.

Copy primbench.hpp to your include directory or use the -I compiler option to point to the path to primbench.hpp.

Include the header in your project and compile with hipcc.

Prerequisites#

  • hipcc

  • A C++17-capable compiler

  • AMD SMI for GPU temperature monitoring

Note

Because AMD SMI isn’t available on Windows, GPU temperature monitoring is unavailable on Windows. Disable GPU monitoring on Windows by compiling with PRIMBENCH_NO_MONITORING.

Compile options#

Primbench behavior is controlled by preprocessor macros passed at compile time.

Macro

Effect

-DPRIMBENCH_NO_MONITORING

Disables GPU temperature monitoring. Required on Windows. Use when AMD SMI isn’t available.

-DPRIMBENCH_NO_TEST

Disables correctness-test execution. state.test() lambdas aren’t called.

-DPRIMBENCH_GPU_CACHE_SIZE=n

Sets the size in bytes of the buffer used to evict GPU caches before each kernel launch. Defaults to 256 * MiB.

-DBRANCH_NAME=\"name\"

Embeds the Git branch name in context.general.branch_name of the JSON output.

-DCOMMIT_HASH=\"hash\"

Embeds the Git commit hash in context.general.commit_hash of the JSON output.

For full descriptions of each macro, see Primbench API.