Skip to content

Commit f56459f

Browse files
authored
Fix STF compilation with nvc++ as host compiler (#8230)
1 parent 4292cbb commit f56459f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

cudax/include/cuda/experimental/__stf/internal/launch.cuh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,16 @@ public:
181181
template <typename Fun>
182182
void operator->*(Fun&& f)
183183
{
184-
# if __NVCOMPILER
184+
# if _CCCL_CUDA_COMPILER(NVHPC)
185185
// With nvc++, all lambdas can run on host and device.
186186
static constexpr bool is_extended_host_device_lambda_closure_type = true,
187187
is_extended_device_lambda_closure_type = false;
188-
# else
188+
# else // ^^^ _CCCL_CUDA_COMPILER(NVHPC) ^^^ / VVV !_CCCL_CUDA_COMPILER(NVHPC) VVV
189189
// With nvcpp, dedicated traits tell how a lambda can be executed.
190190
static constexpr bool is_extended_host_device_lambda_closure_type =
191191
__nv_is_extended_host_device_lambda_closure_type(Fun),
192192
is_extended_device_lambda_closure_type = __nv_is_extended_device_lambda_closure_type(Fun);
193-
# endif
193+
# endif // ^^^ !_CCCL_CUDA_COMPILER(NVHPC) ^^^
194194

195195
static_assert(is_extended_host_device_lambda_closure_type || is_extended_device_lambda_closure_type,
196196
"Cannot run launch() on the host");
@@ -306,16 +306,16 @@ public:
306306
template <typename Fun>
307307
void operator->*(Fun&& f)
308308
{
309-
# if __NVCOMPILER
309+
# if _CCCL_CUDA_COMPILER(NVHPC)
310310
// With nvc++, all lambdas can run on host and device.
311311
static constexpr bool is_extended_host_device_lambda_closure_type = true,
312312
is_extended_device_lambda_closure_type = false;
313-
# else
313+
# else // ^^^ _CCCL_CUDA_COMPILER(NVHPC) ^^^ / VVV !_CCCL_CUDA_COMPILER(NVHPC) VVV
314314
// With nvcpp, dedicated traits tell how a lambda can be executed.
315315
static constexpr bool is_extended_host_device_lambda_closure_type =
316316
__nv_is_extended_host_device_lambda_closure_type(Fun),
317317
is_extended_device_lambda_closure_type = __nv_is_extended_device_lambda_closure_type(Fun);
318-
# endif
318+
# endif // ^^^ !_CCCL_CUDA_COMPILER(NVHPC) ^^^
319319

320320
static_assert(is_extended_device_lambda_closure_type || is_extended_host_device_lambda_closure_type,
321321
"Cannot run launch() on the host");

cudax/include/cuda/experimental/__stf/internal/parallel_for_scope.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,16 +615,16 @@ public:
615615

616616
static constexpr bool need_reduction = (deps_ops_t::does_work || ...);
617617

618-
# if __NVCOMPILER
618+
# if _CCCL_CUDA_COMPILER(NVHPC)
619619
// With nvc++, all lambdas can run on host and device.
620620
static constexpr bool is_extended_host_device_lambda_closure_type = true,
621621
is_extended_device_lambda_closure_type = false;
622-
# else
622+
# else // ^^^ _CCCL_CUDA_COMPILER(NVHPC) ^^^ / vvv !_CCCL_CUDA_COMPILER(NVHPC)
623623
// With nvcpp, dedicated traits tell how a lambda can be executed.
624624
static constexpr bool is_extended_host_device_lambda_closure_type =
625625
__nv_is_extended_host_device_lambda_closure_type(Fun),
626626
is_extended_device_lambda_closure_type = __nv_is_extended_device_lambda_closure_type(Fun);
627-
# endif
627+
# endif // ^^^ !_CCCL_CUDA_COMPILER(NVHPC) ^^^
628628

629629
// TODO redo cascade of tests
630630
if constexpr (need_reduction)

0 commit comments

Comments
 (0)