Skip to content

Update nvbench configuration to use C++20 standard#1141

Open
cliffburdick wants to merge 2 commits intomainfrom
cliffburdick-patch-1
Open

Update nvbench configuration to use C++20 standard#1141
cliffburdick wants to merge 2 commits intomainfrom
cliffburdick-patch-1

Conversation

@cliffburdick
Copy link
Collaborator

No description provided.

@cliffburdick
Copy link
Collaborator Author

/build

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 19, 2026

Greptile Summary

This PR aligns nvbench's compilation standard with the rest of the MatX project by forwarding CMAKE_CXX_STANDARD 20 and CMAKE_CUDA_STANDARD 20 as CPM options when fetching nvbench. The main library already mandates C++20 via target_compile_features(matx INTERFACE cxx_std_20 cuda_std_20) (line 139), so this change ensures the benchmark dependency is compiled consistently under the same standard.

  • Sets CMAKE_CXX_STANDARD 20 so nvbench's host C++ translation units use C++20.
  • Sets CMAKE_CUDA_STANDARD 20 so nvbench's device/CUDA translation units also use C++20, keeping parity with the main project's cuda_std_20 feature requirement.
  • No other files are affected; the bench subdirectory (bench/CMakeLists.txt) links against nvbench::main and matx::matx and is unmodified.

Confidence Score: 5/5

  • This PR is safe to merge — it is a one-line functional change that aligns nvbench's compilation standard with the rest of the project.
  • The change is minimal (4 lines), correct in syntax and semantics, and directly addresses the pre-existing standard mismatch. Both CMAKE_CXX_STANDARD 20 and CMAKE_CUDA_STANDARD 20 are now forwarded, matching the cxx_std_20/cuda_std_20 pair required by matx::matx. No logic, API surface, or other configuration is affected.
  • No files require special attention.

Important Files Changed

Filename Overview
CMakeLists.txt Adds CPM_ARGS OPTIONS "CMAKE_CXX_STANDARD 20" "CMAKE_CUDA_STANDARD 20" to rapids_cpm_nvbench() so that the fetched nvbench dependency is compiled under the same C++20/CUDA 20 standard already required by the main matx library.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[cmake configure: MATX_BUILD_BENCHMARKS=ON] --> B[rapids_cpm_nvbench with CPM_ARGS OPTIONS]
    B --> C{nvbench already found?}
    C -- No --> D[CPM fetches nvbench source]
    D --> E[Configure nvbench with CMAKE_CXX_STANDARD=20 and CMAKE_CUDA_STANDARD=20]
    E --> F[nvbench built with C++20 / CUDA 20]
    C -- Yes --> G[Use pre-installed nvbench]
    F --> H[add_subdirectory bench]
    G --> H
    H --> I[matx_bench links nvbench::main + matx::matx both requiring cxx_std_20 and cuda_std_20]
Loading

Last reviewed commit: "Update CMakeLists.tx..."

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@cliffburdick
Copy link
Collaborator Author

/build

1 similar comment
@cliffburdick
Copy link
Collaborator Author

/build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant