52 void *
u,
int *n,
void *gd,
int *nb,
53 void *b,
void *bo,
int *op,
54 cudaStream_t stream) {
56 if ((*m) == 0)
return;
58 const dim3 nthrds(1024, 1, 1);
59 const dim3 nblcks(((*m)+ 1024 - 1)/ 1024, 1, 1);
64 <<<nblcks, nthrds, 0, stream>>>((
real *)
v, *m, *o, (
int *) dg,
65 (
real *)
u, *n, (
int *) gd,
66 *nb, (
int *) b, (
int *) bo);
71 <<<nblcks, nthrds, 0, stream>>>((
real *)
v, *m, *o, (
int *) dg,
72 (
real *)
u, *n, (
int *) gd,
73 *nb, (
int *) b, (
int *) bo);
78 <<<nblcks, nthrds, 0, stream>>>((
real *)
v, *m, *o, (
int *) dg,
79 (
real *)
u, *n, (
int *) gd,
80 *nb, (
int *) b, (
int *) bo);
85 <<<nblcks, nthrds, 0, stream>>>((
real *)
v, *m, *o, (
int *) dg,
86 (
real *)
u, *n, (
int *) gd,
87 *nb, (
int *) b, (
int *) bo);
97 void *
u,
int *n,
void *gd,
98 int *nb,
void *b,
void *bo,
99 cudaStream_t stream) {
101 if ((*m) == 0)
return;
103 const dim3 nthrds(1024, 1, 1);
104 const dim3 nblcks(((*m)+1024 - 1)/ 1024, 1, 1);
107 <<<nblcks, nthrds, 0, stream>>>((
real *)
v, *m, (
int *) dg,
108 (
real *)
u, *n, (
int *) gd,
109 *nb, (
int *) b, (
int *) bo);
117 int offset,
int n, cudaStream_t stream) {
119 const int nthrds = 1024;
120 const int nblcks = (n + nthrds - 1) / nthrds;
123 <<<nblcks, nthrds, 0, stream>>>((
real *) u_d, (
real *) buf_d + offset,
124 (
int *) dof_d + offset, n);
133 int offset,
int n, cudaStream_t stream) {
135 const int nthrds = 1024;
136 const int nblcks = (n + nthrds - 1) / nthrds;
141 <<<nblcks, nthrds, 0, stream>>>(u_d, buf_d + offset,
146 <<<nblcks, nthrds, 0, stream>>>(u_d, buf_d + offset,
151 <<<nblcks, nthrds, 0, stream>>>(u_d, buf_d + offset,
155 printf(
"%s: unknown gs op %d\n", __FILE__, op);
167 int offset,
int n,
int nc,
int ns,
168 cudaStream_t stream) {
170 const int nthrds = 1024;
171 const int nblcks = (n + nthrds - 1) / nthrds;
174 <<<nblcks, nthrds, 0, stream>>>((
real *) u_d, (
real *) buf_d + nc*offset,
175 (
int *) dof_d + offset, n, nc, ns);
184 int offset,
int n,
int nc,
int ns,
185 cudaStream_t stream) {
187 const int nthrds = 1024;
188 const int nblcks = (n + nthrds - 1) / nthrds;
193 <<<nblcks, nthrds, 0, stream>>>(u_d, buf_d + nc*offset,
194 dof_d + offset, n, nc, ns);
198 <<<nblcks, nthrds, 0, stream>>>(u_d, buf_d + nc*offset,
199 dof_d + offset, n, nc, ns);
203 <<<nblcks, nthrds, 0, stream>>>(u_d, buf_d + nc*offset,
204 dof_d + offset, n, nc, ns);
207 printf(
"%s: unknown gs op %d\n", __FILE__, op);
__global__ void const T *__restrict__ u
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void gs_unpack_max_kernel(T *__restrict__ u, const T *__restrict__ buf, const int32_t *__restrict__ dof, const int n)
__global__ void gather_kernel_min(T *__restrict__ v, const int m, const int o, const int *__restrict__ dg, const T *__restrict__ u, const int n, const int *__restrict__ gd, const int nb, const int *__restrict__ b, const int *__restrict__ bo)
__global__ void scatter_kernel(T *__restrict__ v, const int m, const int *__restrict__ dg, T *__restrict__ u, const int n, const int *__restrict__ gd, const int nb, const int *__restrict__ b, const int *__restrict__ bo)
__global__ void gs_unpack_add_vec_kernel(T *__restrict__ u, const T *__restrict__ buf, const int32_t *__restrict__ dof, const int n, const int nc, const int ns)
__global__ void gs_unpack_max_vec_kernel(T *__restrict__ u, const T *__restrict__ buf, const int32_t *__restrict__ dof, const int n, const int nc, const int ns)
__global__ void gather_kernel_mul(T *__restrict__ v, const int m, const int o, const int *__restrict__ dg, const T *__restrict__ u, const int n, const int *__restrict__ gd, const int nb, const int *__restrict__ b, const int *__restrict__ bo)
__global__ void gs_pack_kernel(const T *__restrict__ u, T *__restrict__ buf, const int32_t *__restrict__ dof, const int n)
__global__ void gs_unpack_min_kernel(T *__restrict__ u, const T *__restrict__ buf, const int32_t *__restrict__ dof, const int n)
__global__ void gather_kernel_add(T *__restrict__ v, const int m, const int o, const int *__restrict__ dg, const T *__restrict__ u, const int n, const int *__restrict__ gd, const int nb, const int *__restrict__ b, const int *__restrict__ bo)
__global__ void gs_unpack_add_kernel(T *__restrict__ u, const T *__restrict__ buf, const int32_t *__restrict__ dof, const int n)
__global__ void gather_kernel_max(T *__restrict__ v, const int m, const int o, const int *__restrict__ dg, const T *__restrict__ u, const int n, const int *__restrict__ gd, const int nb, const int *__restrict__ b, const int *__restrict__ bo)
__global__ void gs_unpack_min_vec_kernel(T *__restrict__ u, const T *__restrict__ buf, const int32_t *__restrict__ dof, const int n, const int nc, const int ns)
__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)
void cuda_gs_unpack(real *u_d, int op, real *buf_d, int *dof_d, int offset, int n, cudaStream_t stream)
void cuda_gs_pack(void *u_d, void *buf_d, void *dof_d, int offset, int n, cudaStream_t stream)
void cuda_gather_kernel(void *v, int *m, int *o, void *dg, void *u, int *n, void *gd, int *nb, void *b, void *bo, int *op, cudaStream_t stream)
void cuda_scatter_kernel(void *v, int *m, void *dg, void *u, int *n, void *gd, int *nb, void *b, void *bo, cudaStream_t stream)
void cuda_gs_pack_vec(void *u_d, void *buf_d, void *dof_d, int offset, int n, int nc, int ns, cudaStream_t stream)
void cuda_gs_unpack_vec(real *u_d, int op, real *buf_d, int *dof_d, int offset, int n, int nc, int ns, cudaStream_t stream)