Commit Graph

18 Commits

Author SHA1 Message Date
Allison Piper
a6df59a9b5 Add support for CPU-only benchmarking.
Fixes #95.

CPU-only mode is enabled by setting the `is_cpu_only` property while
defining a benchmark, e.g. `NVBENCH_BENCH(foo).set_is_cpu_only(true)`.

An optional `nvbench::exec_tag::no_gpu` hint can also be passed to
`state.exec` to avoid instantiating GPU benchmarking backends. Note that
a CUDA compiler and CUDA runtime are always required, even if all benchmarks
in a translation unit are CPU-only.

Similarly, a new `nvbench::exec_tag::gpu` hint can be used to avoid
compiling CPU-only backends for GPU benchmarks.
2025-04-08 11:17:23 -04:00
Allison Piper
93ea533fd3 Drop support for MSVC. 2025-04-04 22:17:03 +00:00
Allison Piper
a0f2fab72b Squashed commit of the following:
commit c5b2fc0a8b
Author: Allison Piper <alliepiper16@gmail.com>
Date:   Sat Apr 6 21:48:20 2024 +0000

    Add supported compilers and tools in README.md.

commit 92fe366da5
Author: Allison Piper <alliepiper16@gmail.com>
Date:   Sat Apr 6 20:45:30 2024 +0000

    Fix issues discovered by header tests.

commit f7f6c92143
Author: Allison Piper <alliepiper16@gmail.com>
Date:   Sat Apr 6 20:45:06 2024 +0000

    Setup header tests, add C++20 header tests + examples.

    The core library will always be built with C++17, but
    we test our headers / examples under 17 and 20.

commit 4b24f26b66
Author: Allison Piper <alliepiper16@gmail.com>
Date:   Sat Apr 6 16:21:42 2024 +0000

    Pass CUDA FLAGS to install tests.

commit 4fb672ae91
Author: Allison Piper <alliepiper16@gmail.com>
Date:   Sat Apr 6 15:43:41 2024 +0000

    Add newer GCC (13) and Clang (17, 18).
2024-04-06 22:05:40 +00:00
Allison Piper
a2f88ff790 Set CUDA_MODULE_LOADING=EAGER before main. (#157)
* Set `CUDA_MODULE_LOADING=EAGER` before `main`.

Fixes #136

* Portability for `setenv`.

* Remove pre-main CUDART usage and setup env in main.

* Fail examples if they deadlock.

This is the best way we have to diagnose a regression for
NVIDIA/nvbench#136.

* Add an initialize method to benchmark_manager for CUDA-related setup.

Benchmarks are created statically, so their constructors cannot call the CUDA APIs without breaking the CUDA_MODULE_LOAD setup.

This method is called from `main` after the environment has been configured.
2024-04-06 11:03:42 -04:00
Georgii Evtushenko
42d99a5753 Fix MSVC (#158)
* Fix MSVC

* Revert change of source list name
2024-04-04 09:53:30 -07:00
Georgy Evtushenko
88cc582cea ABC 2024-01-08 13:03:33 -08:00
Georgy Evtushenko
b789240c76 Entropy-based stopping criterion 2024-01-05 14:59:48 -08:00
Allison Vacanti
6c2c53ed4a Reduce time spent smoketesting examples. 2022-02-11 13:54:40 -05:00
Yunsong Wang
fde2e408de Add stream benchmark example 2022-02-07 13:09:35 -05:00
Allison Vacanti
5d70492714 Enable more warning flags.
- /W4 on MSVC
- -Wall -Wextra + others on gcc/clang
- New NVBench_ENABLE_WERROR option to toggle "warnings as errors"
- Mark the nlohmann_json library as IMPORTED to switch to system includes
- Rename nvbench_main -> nvbench.main to follow target name conventions
- Explicitly suppress some cudafe warnings when compiling templates in
  nlohmann_json headers.
- Explicitly suppress some warnings from Thrust headers.
- Various fixes for warnings exposed by new flags.
- Disable CUPTI on CTK < 11.3 (See #52).
2021-12-18 20:13:25 -05:00
Georgy Evtushenko
1bc715267c CUPTI support 2021-12-18 12:03:52 +03:00
Allison Vacanti
ef36d3a558 Port to rapids-cmake.
- Add export sets
- Add install rules
- Remove manual CPM import, port to rapids_cpm_*, etc
- Organize CMake code into cmake/*.cmake files.
- NVBench is now a shared library.
2021-10-20 14:02:16 -04:00
Allison Vacanti
e62c786498 Set small timeout when running examples with ctest. 2021-03-18 13:33:50 -04:00
Allison Vacanti
ea53972af8 Add nvbench.all metatarget.
This builds all NVBench tests and examples without building targets in
any parent projects.
2021-03-18 13:33:23 -04:00
Allison Vacanti
60c94d9ed6 Add enum_type_axis and examples/enums.cu.
- `enum_type_axis` simplifies using integral_constants with type axes.
- `examples/enums.cu` demonstrates various ways of implementing parameter
  sweeps with enum types.
2021-03-16 13:57:52 -04:00
Allison Vacanti
f15b668b03 Add nvbench.test.all and nvbench.example.all metatargets. 2021-03-09 16:03:14 -05:00
Allison Vacanti
3fc75f5ea6 Add more examples.
- exec_tag_timer
- exec_tag_sync
- skip
- throughput
2021-03-09 16:03:14 -05:00
Allison Vacanti
c133784763 Add the first example.
- New NVBench_ENABLE_EXAMPLES CMake option.
- examples/axis.cu provides examples of parameter sweeps.
- Moves testing/sleep_kernel.cuh -> nvbench/test_kernels.cuh
  - Accessible to examples and provides some built-in kernels for users
    to experiement with.
  - Not included with `<nvbench/nvbench.cuh>`.
2021-03-08 18:26:26 -05:00