fix(CCCL): split compilation to isolate CCCL headers from torch/corex

Two problems from real BI-V100 build:

1. 'CUDA versions below 12 are not supported'
   → Add CCCL_IGNORE_DEPRECATED_CUDA_BELOW_12 (official suppress macro)

2. corex thrust/complex.h conflicts with CCCL thrust headers
   → Split into two compilation units:
     - cccl_moe_sort_scatter.cu: CCCL headers only, C API, no torch
     - cccl_moe_sort_scatter_pybind.cpp: torch headers only, no CCCL
   Same pattern as proven cccl_allocator_preload.cu

3. Variadic device functions rejected by corex clang:
   → is_referenceable.h: __test(...) → __test(long)
   → invoke.h: __any(...) → template __any(_T)
   → conjunction.h: __and_helper(...) → __and_helper(long)
   SFINAE still works: int overload wins, long is fallback.
This commit is contained in:
project6-dev
2026-08-13 11:35:43 +00:00
parent 05706f0d60
commit f6cf9d662e
6 changed files with 168 additions and 142 deletions

View File

@@ -43,7 +43,8 @@ _CCCL_BEGIN_NAMESPACE_CUDA_STD
struct __any
{
_CCCL_API inline __any(...);
template <class _T>
_CCCL_API inline __any(_T);
};
template <class _DecayedFp>

View File

@@ -35,7 +35,7 @@ template <class... _Pred>
_CCCL_HOST_DEVICE __expand_to_true<enable_if_t<_Pred::value>...> __and_helper(int);
template <class...>
_CCCL_HOST_DEVICE false_type __and_helper(...);
_CCCL_HOST_DEVICE false_type __and_helper(long);
// _And always performs lazy evaluation of its arguments.
//

View File

@@ -39,7 +39,7 @@ struct __cccl_is_referenceable_impl
template <class _Tp>
_CCCL_HOST_DEVICE static _Tp& __test(int);
template <class _Tp>
_CCCL_HOST_DEVICE static false_type __test(...);
_CCCL_HOST_DEVICE static false_type __test(long);
};
template <class _Tp>