Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion projects/rocthrust/thrust/detail/functional/actor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2024 NVIDIA Corporation
* Modifications Copyright© 2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,6 +41,15 @@ namespace detail
namespace functional
{

// If we have libstdc++ >= 10, we can use the __decay_t
// builtin to reduce compilation time.
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
Comment on lines +46 to +51
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)


// An actor is a node in an expression template
template <typename Eval>
struct actor : Eval
Expand Down Expand Up @@ -197,7 +207,7 @@ struct value
};

template <typename T>
THRUST_HOST_DEVICE auto make_actor(T&& x) -> actor<value<std::__decay_t<T>>>
THRUST_HOST_DEVICE auto make_actor(T&& x) -> actor<value<thrust::detail::functional::decay_t<T>>>
{
return {{THRUST_FWD(x)}};
}
Expand Down
Loading