Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CUDA-compiler specific CUB headers do nothing in other compilers #3378

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions cub/cub/detail/launcher/cuda_runtime.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
# pragma system_header
#endif // no system header

#include <cub/util_device.cuh>
#if _CCCL_HAS_CUDA_COMPILER
caugonnet marked this conversation as resolved.
Show resolved Hide resolved

#include <thrust/system/cuda/detail/core/triple_chevron_launch.h>
# include <cub/util_device.cuh>

# include <thrust/system/cuda/detail/core/triple_chevron_launch.h>

CUB_NAMESPACE_BEGIN

Expand Down Expand Up @@ -56,3 +58,5 @@ struct TripleChevronFactory
} // namespace detail

CUB_NAMESPACE_END

#endif // _CCCL_CUDA_COMPILER
6 changes: 5 additions & 1 deletion cub/cub/util_device.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ CUB_RUNTIME_FUNCTION PolicyWrapper<PolicyT> MakePolicyWrapper(PolicyT policy)
return PolicyWrapper<PolicyT>{policy};
}

#if _CCCL_HAS_CUDA_COMPILER
namespace detail
{
struct TripleChevronFactory;
Expand Down Expand Up @@ -639,6 +640,7 @@ struct KernelConfig
return launcher_factory.MaxSmOccupancy(sm_occupancy, kernel_ptr, block_threads);
}
};
#endif // _CCCL_HAS_CUDA_COMPILER

/// Helper for dispatching into a policy chain
template <int PolicyPtxVersion, typename PolicyT, typename PrevPolicyT>
Expand Down Expand Up @@ -759,4 +761,6 @@ private:

CUB_NAMESPACE_END

#include <cub/detail/launcher/cuda_runtime.cuh> // to complete the definition of TripleChevronFactory
#if _CCCL_HAS_CUDA_COMPILER
# include <cub/detail/launcher/cuda_runtime.cuh> // to complete the definition of TripleChevronFactory
#endif // _CCCL_HAS_CUDA_COMPILER
Loading