Skip to content

Fix leftover configure placeholders in cutlass/version.h - #3483

Open
VaggelisGian wants to merge 1 commit into
NVIDIA:mainfrom
VaggelisGian:fix-version-h-placeholders
Open

Fix leftover configure placeholders in cutlass/version.h#3483
VaggelisGian wants to merge 1 commit into
NVIDIA:mainfrom
VaggelisGian:fix-version-h-placeholders

Conversation

@VaggelisGian

Copy link
Copy Markdown

Fixes #3472

getVersionString() and getGitRevision() in include/cutlass/version.h returned the literal strings @CUTLASS_VERSION@ and @CUTLASS_REVISION@. Those were left behind when the configure_file step for version.h was dropped in 3.4.1 (bbe579a); only cmake/version_extended.h.in is generated, so nothing ever substituted them, and even a full CMake build prints CUTLASS @CUTLASS_VERSION@ in the profiler banner (tools/profiler/src/options.cu).

This builds getVersionString() from the CUTLASS_MAJOR/MINOR/PATCH macros and lets getGitRevision() return CUTLASS_REVISION, which is empty by default and supplied by version_extended.h under CUTLASS_VERSIONS_GENERATED. The build-number suffix behavior is unchanged.

Behavior note: the profiler banner changes from CUTLASS @CUTLASS_VERSION@ ... commit @CUTLASS_REVISION@ to CUTLASS 4.7.0, with the commit clause printed only when a real revision exists. Nothing in-tree parses the old string.

Adds test/unit/core/version.cu (3 tests) registered in test/unit/core/CMakeLists.txt.

Test Plan:

$ docker run --rm -v .../cutlass:/src:ro nvidia/cuda:12.8.1-devel-ubuntu22.04 \
    g++ -std=c++17 -I/src/include host_check.cpp && ./host_check
  unfixed header: getVersionString=@CUTLASS_VERSION@
                  getGitRevision=@CUTLASS_REVISION@   -> 4 assertion failures
  fixed header:   getVersionString=4.7.0 getGitRevision=    -> 0 failures

$ docker run --rm nvidia/cuda:12.8.1-devel-ubuntu22.04   # nvcc V12.8.93 + googletest
$ nvcc -std=c++17 -I<include> -I<gtest include> -c test/unit/core/version.cu ...
$ g++ version.o libgtest.a libgtest_main.a -lcudart -o vt && ./vt
[==========] 3 tests from 1 test suite ran. (1 ms total)
[  PASSED  ] 3 tests.

Both configurations were also compiled with MSVC against a simulated generated version_extended.h: defaults give "4.7.0"/"", generated gives "4.7.0.5"/"abc123".

getVersionString() and getGitRevision() returned the literal strings
"@CUTLASS_VERSION@" and "@CUTLASS_REVISION@". Those were left behind
when the configure_file step for version.h was dropped in 3.4.1; only
cmake/version_extended.h.in is generated, so nothing ever substituted
them and even a full CMake build printed "CUTLASS @CUTLASS_VERSION@"
in the profiler banner.

Build getVersionString() from the CUTLASS_MAJOR/MINOR/PATCH macros and
let getGitRevision() return CUTLASS_REVISION, which is empty by default
and supplied by version_extended.h under CUTLASS_VERSIONS_GENERATED.
The build-number suffix behavior is unchanged.

Add test/unit/core/version.cu asserting both accessors agree with the
numeric accessors and never contain placeholder markers.

Test Plan:
  docker g++ -std=c++17 host program including cutlass/version.h:
    unfixed header: getVersionString=@CUTLASS_VERSION@
      getGitRevision=@CUTLASS_REVISION@, 4 assertion failures
    fixed header: getVersionString=4.7.0, getGitRevision="", 0 failures
  docker nvcc 12.8.1 + googletest on test/unit/core/version.cu:
    [ PASSED ] 3 tests.
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.

[BUG] Installed headers return CMake / configure_file placeholders for version numbers

1 participant