Skip to content

[rocThrust] Add fallback to std::decay_t when building against old libstdc++#200

Merged
umfranzw merged 1 commit into
ROCm:release-staging/rocm-rel-7.0from
umfranzw:fix_std_decay_bug
Jun 12, 2025
Merged

[rocThrust] Add fallback to std::decay_t when building against old libstdc++#200
umfranzw merged 1 commit into
ROCm:release-staging/rocm-rel-7.0from
umfranzw:fix_std_decay_bug

Conversation

@umfranzw
Copy link
Copy Markdown
Contributor

The recent updates for CCCL 2.7 compatibility introduced a call to the built-in function std::__decay_t. This built-in can be used in place of std::decay_t to reduce compilation time. It is defined starting with libstdc++-10. However, RHEL 8 still uses libstdc++-8.x.

This change introduces a fall-back to std::decay_t in cases where we're building against an older libstdc++.

The recent updates for CCCL 2.7 compatibility introduced a call
to the builtin function std::__decay_t. This builtin can be used
in place of std::decay_t to reduce compilation time. It is defined
starting with libstdc++-10. However, RHEL 8 still uses libstdc++-8.x.

This change introduces a fall-back to std::decay_t in cases where
we're building against an older libstdc++.
@umfranzw umfranzw force-pushed the fix_std_decay_bug branch from 7525bdd to 1bf4a69 Compare June 12, 2025 18:49
@umfranzw umfranzw changed the title Add fallback to std::decay_t when building against old libstdc++ [rocThrust] Add fallback to std::decay_t when building against old libstdc++ Jun 12, 2025
@umfranzw umfranzw merged commit db56e5c into ROCm:release-staging/rocm-rel-7.0 Jun 12, 2025
31 of 35 checks passed
assistant-librarian Bot pushed a commit to ROCm/rocThrust that referenced this pull request Jun 12, 2025
[rocThrust] Add fallback to std::decay_t when building
 against old libstdc++ (#200)

The recent updates for CCCL 2.7 compatibility introduced a call to the
built-in function std::__decay_t. This built-in can be used in place of
std::decay_t to reduce compilation time. It is defined starting with
libstdc++-10. However, RHEL 8 still uses libstdc++-8.x.

This change introduces a fall-back to std::decay_t in cases where we're
building against an older libstdc++.
jayhawk-commits pushed a commit that referenced this pull request Jun 17, 2025
…bstdc++ (#200)

The recent updates for CCCL 2.7 compatibility introduced a call to the
built-in function std::__decay_t. This built-in can be used in place of
std::decay_t to reduce compilation time. It is defined starting with
libstdc++-10. However, RHEL 8 still uses libstdc++-8.x.

This change introduces a fall-back to std::decay_t in cases where we're
building against an older libstdc++.
jayhawk-commits added a commit that referenced this pull request Jun 20, 2025
### Includes the following PRs:

- #121
- #122 
- #123 
- #146 
- #191 
- #200

---------

Co-authored-by: Mátyás Aradi <matyas@streamhpc.com>
Co-authored-by: Alex Voicu <alexandru.voicu@amd.com>
Co-authored-by: Ioannis Assiouras <38722728+iassiour@users.noreply.github.com>
Co-authored-by: Nara <nara@streamhpc.com>
Co-authored-by: Wayne Franz <wayfranz@amd.com>
Comment on lines +46 to +51
template<typename T>
#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 10
using decay_t = std::decay_t<T>;
#else
using decay_t = std::__decay_t<T>;
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on PR #224, this change breaks compiling rocThrust on Windows with MSVC:

[rocThrust] C:/home/runner/_work/TheRock/TheRock/math-libs/rocThrust/thrust/..\thrust/detail/functional/actor.h:50:22: error: no template named '__decay_t' in namespace 'std'; did you mean 'decay_t'?
[rocThrust]    50 | using decay_t = std::__decay_t<T>;
[rocThrust]       |                 ~~~~~^~~~~~~~~
[rocThrust]       |                      decay_t
[rocThrust] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\type_traits:1267:1: note: 'decay_t' declared here

[rocThrust]  1267 | using decay_t = typename decay<_Ty>::type;

[rocThrust]       | ^

[rocThrust] 1 error generated when compiling for gfx1100.

(from https://github.com/ROCm/TheRock/actions/runs/15784597552/job/44498186375?pr=882#step:12:725)

ammallya pushed a commit that referenced this pull request Jul 11, 2025
Co-authored-by: chiahlin <chiahlin@banff-cyxtera-s73-1.ctr.dcgpu>

[ROCm/hipSPARSELt commit: eb9e7f9]
ammallya pushed a commit that referenced this pull request Sep 24, 2025
…nning tests elsewhere (#200)

* commit initial tests.cmake

* comment out for test

* first set of fixes to load relative to binary instead of working dir

* fix tests for TestPlugin.cpp

* fix shared library

* change backend logger to return the logger to its default state after each test.

* create a test project during buildtime that can be used in order to launch all of our tests correctly wherever we copy our build directory.

* undo changes to file.  i didnt realize we were doing a full logging init refactor

* fix check command

* Use cmake build dir to fix tests

* Remove empty file

* Fix code coverage

* Clean up path resolution

* Fix all tests after loading relative to module

* Fix test name checker

* Cmake vars for external plugins

* Use rel path for comparisons and remove abs paths

* Move all plugins to lib and format

* Lots of cleanup

* Move method and fix RPATH config

* Make global

* Final cleanup

* Modify scoped env to set vars

* Move RPATH settings to function called per executable

* Add nullptr checks to GraphWrapper.

* Format

---------

Co-authored-by: Samuel Reeder <samuel.reeder@amd.com>
ammallya pushed a commit that referenced this pull request Sep 24, 2025
…nning tests elsewhere (#200)

* commit initial tests.cmake

* comment out for test

* first set of fixes to load relative to binary instead of working dir

* fix tests for TestPlugin.cpp

* fix shared library

* change backend logger to return the logger to its default state after each test.

* create a test project during buildtime that can be used in order to launch all of our tests correctly wherever we copy our build directory.

* undo changes to file.  i didnt realize we were doing a full logging init refactor

* fix check command

* Use cmake build dir to fix tests

* Remove empty file

* Fix code coverage

* Clean up path resolution

* Fix all tests after loading relative to module

* Fix test name checker

* Cmake vars for external plugins

* Use rel path for comparisons and remove abs paths

* Move all plugins to lib and format

* Lots of cleanup

* Move method and fix RPATH config

* Make global

* Final cleanup

* Modify scoped env to set vars

* Move RPATH settings to function called per executable

* Add nullptr checks to GraphWrapper.

* Format

---------

Co-authored-by: Samuel Reeder <samuel.reeder@amd.com>

[ROCm/hipDNN commit: e042b03]
evetsso pushed a commit to evetsso/rocm-libraries that referenced this pull request Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants