46 void cudamalloc_nvshmem(
void** ptr,
size_t size)
48 *ptr = nvshmem_malloc(size);
50 cudaMemset(*ptr, 0, size);
54 void cudafree_nvshmem(
void** ptr,
size_t size)
67 void cuda_gs_nvshmem_pack(
void *u_d,
void *buf_d,
void *dof_d,
68 int boffset,
int n, cudaStream_t stream)
72 const int nthrds = 1024;
73 const int nblcks = (n + nthrds - 1) / nthrds;
76 <<<nblcks, nthrds, 0, stream>>>((
real *) u_d, (
real *) buf_d + boffset,
86 void cuda_gs_nvshmem_pack_vec(
void *u_d,
void *buf_d,
void *dof_d,
87 int boffset,
int n,
int nc,
int ns,
92 const int nthrds = 1024;
93 const int nblcks = (n + nthrds - 1) / nthrds;
96 <<<nblcks, nthrds, 0, stream>>>((
real *) u_d, (
real *) buf_d + boffset,
97 (
int *) dof_d, n, nc, ns);
108 void cuda_gs_push(
void *sbuf_d,
int soffset,
int n, cudaStream_t stream,
109 int destRank,
void *rbuf_d,
int roffset,
int iter,
110 void *done_d,
void *ready_d,
int mype)
112 const int nthrds = 1024;
115 <<<1,nthrds,0,stream>>>((
real *) rbuf_d + roffset,
116 (
real *) sbuf_d + soffset,
117 (
size_t) n, destRank, (uint64_t) iter,
118 (uint64_t *) done_d + mype,
119 (uint64_t *) ready_d + destRank);
127 void cuda_gs_push_wait(cudaStream_t stream,
int iter,
128 void *done_d,
int srcRank)
131 (uint64_t *) done_d + srcRank);
140 void cuda_gs_post_ready(cudaStream_t stream,
int iter,
void *ready_d,
141 int mype,
int srcRank)
144 (uint64_t) iter, srcRank);
__global__ void gs_pack_kernel(const T *__restrict__ u, T *__restrict__ buf, const int32_t *__restrict__ dof, const int n)
__global__ void gs_pack_vec_kernel(const T *__restrict__ u, T *__restrict__ buf, const int32_t *__restrict__ dof, const int n, const int nc, const int ns)
__global__ void pushShmemKernelWait(uint64_t iter, uint64_t *doneSlot)
__global__ void postReadyShmemKernel(uint64_t *readySlot, uint64_t iter, const int srcRank)
__global__ void pushShmemKernel(T *dest, const T *__restrict__ src, const size_t n, const int destRank, uint64_t iter, uint64_t *doneSig, uint64_t *readySlot)