35#include <hip/hip_runtime.h>
53 void *
u,
int *n,
void *gd,
int *nb,
54 void *b,
void *bo,
int *op,
57 if ((*m) == 0)
return;
59 const dim3 nthrds(1024, 1, 1);
60 const dim3 nblcks(((*m)+ 1024 - 1)/ 1024, 1, 1);
65 nblcks, nthrds, 0, stream,
66 (
real *)
v, *m, *o, (
int *) dg,
67 (
real *)
u, *n, (
int *) gd,
68 *nb, (
int *) b, (
int *) bo);
73 nblcks, nthrds, 0, stream,
74 (
real *)
v, *m, *o, (
int *) dg,
75 (
real *)
u, *n, (
int *) gd,
76 *nb, (
int *) b, (
int *) bo);
81 nblcks, nthrds, 0, stream,
82 (
real *)
v, *m, *o, (
int *) dg,
83 (
real *)
u, *n, (
int *) gd,
84 *nb, (
int *) b, (
int *) bo);
89 nblcks, nthrds, 0, stream,
90 (
real *)
v, *m, *o, (
int *) dg,
91 (
real *)
u, *n, (
int *) gd,
92 *nb, (
int *) b, (
int *) bo);
102 void *
u,
int *n,
void *gd,
103 int *nb,
void *b,
void *bo,
104 hipStream_t stream) {
106 if ((*m) == 0)
return;
108 const dim3 nthrds(1024, 1, 1);
109 const dim3 nblcks(((*m)+1024 - 1)/ 1024, 1, 1);
112 nblcks, nthrds, 0, stream,
113 (
real *)
v, *m, (
int *) dg,
114 (
real *)
u, *n, (
int *) gd,
115 *nb, (
int *) b, (
int *) bo);
123 int offset,
int n, hipStream_t stream) {
125 const int nthrds = 1024;
126 const int nblcks = (n + nthrds - 1) / nthrds;
129 nblcks, nthrds, 0, stream,
130 (
real *) u_d, (
real *) buf_d + offset,
131 (
int *) dof_d + offset, n);
139 int offset,
int n, hipStream_t stream) {
141 const int nthrds = 1024;
142 const int nblcks = (n + nthrds - 1) / nthrds;
147 nblcks, nthrds, 0, stream,
154 nblcks, nthrds, 0, stream,
160 nblcks, nthrds, 0, stream,
165 printf(
"%s: unknown gs op %d\n", __FILE__, op);
177 int offset,
int n,
int nc,
int ns,
178 hipStream_t stream) {
180 const int nthrds = 1024;
181 const int nblcks = (n + nthrds - 1) / nthrds;
184 nblcks, nthrds, 0, stream,
185 (
real *) u_d, (
real *) buf_d + nc*offset,
186 (
int *) dof_d + offset, n, nc, ns);
194 int offset,
int n,
int nc,
int ns,
195 hipStream_t stream) {
197 const int nthrds = 1024;
198 const int nblcks = (n + nthrds - 1) / nthrds;
203 nblcks, nthrds, 0, stream,
204 u_d, buf_d + nc*offset, dof_d + offset, n, nc, ns);
208 nblcks, nthrds, 0, stream,
209 u_d, buf_d + nc*offset, dof_d + offset, n, nc, ns);
213 nblcks, nthrds, 0, stream,
214 u_d, buf_d + nc*offset, dof_d + offset, n, nc, ns);
217 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 hip_gs_unpack(real *u_d, int op, real *buf_d, int *dof_d, int offset, int n, hipStream_t stream)
void hip_scatter_kernel(void *v, int *m, void *dg, void *u, int *n, void *gd, int *nb, void *b, void *bo, hipStream_t stream)
void hip_gs_pack(void *u_d, void *buf_d, void *dof_d, int offset, int n, hipStream_t stream)
void hip_gs_pack_vec(void *u_d, void *buf_d, void *dof_d, int offset, int n, int nc, int ns, hipStream_t stream)
void hip_gs_unpack_vec(real *u_d, int op, real *buf_d, int *dof_d, int offset, int n, int nc, int ns, hipStream_t stream)
void hip_gather_kernel(void *v, int *m, int *o, void *dg, void *u, int *n, void *gd, int *nb, void *b, void *bo, int *op, hipStream_t stream)