36#include <hip/hip_runtime.h>
68 hipMemcpyDeviceToHost, stream));
75 hipMemcpyDeviceToHost, stream));
85 real *omega,
int *n) {
90 const dim3 nthrds(1024, 1, 1);
91 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
95 nblcks, nthrds, 0, stream,
108 const dim3 nthrds(1024, 1, 1);
109 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
110 const int nb = ((*n) + 1024 - 1) / 1024;
114 2 * (nb > 1 ? nb : 1) *
sizeof(
real_xp));
121 nblcks, nthrds, 0, stream,
125 2, 1024, 0, stream, dev, nb, 2);
142 real *alpha,
int *n) {
144 const dim3 nthrds(1024, 1, 1);
145 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
146 const int nb = ((*n) + 1024 - 1) / 1024;
150 2 * (nb > 1 ? nb : 1) *
sizeof(
real_xp));
156 nblcks, nthrds, 0, stream,
158 (
real *) mult, dev, *alpha, *n);
161 1, 1024, 0, stream, dev, nb);
179 void *s,
void *t,
void *f,
void *mult,
182 const dim3 nthrds(1024, 1, 1);
183 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
184 const int nb = ((*n) + 1024 - 1) / 1024;
188 2 * (nb > 1 ? nb : 1) *
sizeof(
real_xp));
194 nblcks, nthrds, 0, stream,
198 (
real *) mult, dev, *alpha, *omega, *n);
201 2, 1024, 0, stream, dev, nb, 2);
cuda_buffer_t bicgstab_redbuf
void hip_bicgstab_product_and_norm(void *a, void *b, void *mult, real_xp *res, int *n)
void hip_bicgstab_update_p(void *p, void *r, void *v, real *beta, real *omega, int *n)
void hip_bicgstab_part2(void *x, void *r, void *p_hat, void *s_hat, void *s, void *t, void *f, void *mult, real *alpha, real *omega, real_xp *res, int *n)
static void bicgstab_reduce(real_xp *host, real_xp *dev, const int count, hipStream_t stream)
real_xp hip_bicgstab_part1(void *s, void *r, void *v, void *mult, real *alpha, int *n)
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void bicgstab_update_p_kernel(T *__restrict__ p, const T *__restrict__ r, const T *__restrict__ v, const T beta, const T omega, const int n)
__global__ void bicgstab_product_and_norm_kernel(const T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ mult, T_acc *__restrict__ buf_h, const int n)
__global__ void bicgstab_part1_kernel(T *__restrict__ s, const T *__restrict__ r, const T *__restrict__ v, const T *__restrict__ mult, T_acc *__restrict__ buf_h, const T alpha, const int n)
__global__ void bicgstab_part2_kernel(T *__restrict__ x, T *__restrict__ r, const T *__restrict__ p_hat, const T *__restrict__ s_hat, const T *__restrict__ s, const T *__restrict__ t, const T *__restrict__ f, const T *__restrict__ mult, T_acc *__restrict__ buf_h, const T alpha, const T omega, const int n)
__global__ void const T *__restrict__ x
__global__ void reduce_kernel(T *bufred, const int n)
__global__ void glsc3_reduce_kernel(T_acc *bufred, const int n, const int j)
void device_mpi_allreduce(void *buf_d, void *buf, int count, int nbytes, int op)
void device_nccl_allreduce(void *sbuf_d, void *rbuf_d, int count, int nbytes, int op, void *stream)
void hip_buffer_reserve(hip_buffer_t *buf, size_t size)
struct hip_buffer hip_buffer_t