50 int *p_cur,
int *p_space,
int *n) {
52 const dim3 nthrds(1024, 1, 1);
53 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
57 <<<nblcks, nthrds, 0, stream>>>((
real *)
x, (
real *) p,
59 (
real *) beta, *p_cur, *p_space, *n);
65 void *u2,
void *
w,
void *z,
66 void *ni,
void *mi,
real *alpha,
67 real *beta,
void *mult,
68 real *reduction,
int *n) {
70 const dim3 nthrds(1024, 1, 1);
71 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
72 const int nb = ((*n) + 1024 - 1)/ 1024;
78 real *buf_d2 = buf_d1 + nb;
79 real *buf_d3 = buf_d1 + 2*nb;
82 <<<nblcks, nthrds, 0, stream>>>((
real *) p, (
real *) q,
87 *alpha, *beta, (
real *)mult,
88 buf_d1, buf_d2, buf_d3, *n);
100 cudaMemcpyDeviceToHost, stream));
103 cudaMemcpyDeviceToHost, stream));
106 cudaMemcpyDeviceToHost, stream));
111 reduction[0] = buf[0];
112 reduction[1] = buf[1];
113 reduction[2] = buf[2];
void cuda_buffer_reserve(cuda_buffer_t *buf, size_t size)
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__global__ void const T *__restrict__ u
struct cuda_buffer cuda_buffer_t
__global__ void const T *__restrict__ x
__global__ void reduce_kernel(T *bufred, const int n)
__global__ void pipecg_vecops_kernel(T *__restrict__ p, T *__restrict__ q, T *__restrict__ r, T *__restrict__ s, T *__restrict__ u1, T *__restrict__ u2, T *__restrict__ w, T *__restrict__ z, T *__restrict__ ni, T *__restrict__ mi, const T alpha, const T beta, const T *mult, T *buf_h1, T *buf_h2, T *buf_h3, const int n)
__global__ void cg_update_xp_kernel(T *__restrict__ x, T *__restrict__ p, T **__restrict__ u, const T *alpha, const T *beta, const int p_cur, const int p_space, const int n)
void cuda_pipecg_vecops(void *p, void *q, void *r, void *s, void *u1, void *u2, void *w, void *z, void *ni, void *mi, real *alpha, real *beta, void *mult, real *reduction, int *n)
void cuda_cg_update_xp(void *x, void *p, void *u, void *alpha, void *beta, int *p_cur, int *p_space, int *n)