Skip to content
Merged
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
13 changes: 12 additions & 1 deletion include/internal/cudecomp_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@
#include <cstddef>
#include <cstdint>

// Keep NVSHMEM device headers out of non-RDC CUDA translation units.
#if defined(ENABLE_NVSHMEM) && defined(CUDECOMP_NVSHMEM_HOST_ONLY) && !defined(NVSHMEM_HOSTLIB_ONLY)
#define CUDECOMP_UNDEF_NVSHMEM_HOSTLIB_ONLY
#define NVSHMEM_HOSTLIB_ONLY
#endif

#ifdef ENABLE_NVSHMEM
#include <nvshmem.h>
#endif

#include "internal/cudecomp_kernels.h"

#ifdef CUDECOMP_UNDEF_NVSHMEM_HOSTLIB_ONLY
#undef NVSHMEM_HOSTLIB_ONLY
#undef CUDECOMP_UNDEF_NVSHMEM_HOSTLIB_ONLY
#endif

#define CUDECOMP_CUDA_NTHREADS (128)
#define CUDECOMP_UNROLL_FACTOR (4)
#define CUDECOMP_MIN_BLOCKS_PER_SM (16)
Expand All @@ -36,7 +47,7 @@

namespace cudecomp {

#ifdef ENABLE_NVSHMEM
#if defined(ENABLE_NVSHMEM) && !defined(CUDECOMP_NVSHMEM_HOST_ONLY)
template <typename T>
__launch_bounds__(CUDECOMP_CUDA_NTHREADS) __global__
void cudecomp_nvshmem_alltoallv_k(cudecompNvshmemA2AParams<T> params) {
Expand Down
4 changes: 4 additions & 0 deletions src/cudecomp_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#include <cuda/std/complex>

#include "internal/checks.h"

// This non-RDC translation unit only instantiates generic CUDA kernels.
#define CUDECOMP_NVSHMEM_HOST_ONLY
#include "internal/cudecomp_kernels.cuh"
#undef CUDECOMP_NVSHMEM_HOST_ONLY

namespace cudecomp {

Expand Down
Loading