92 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
93 const int str = blockDim.x * gridDim.x;
98 __shared__ T buf1[64];
99 __shared__ T buf2[64];
100 __shared__ T buf3[64];
105 for (
int i = idx;
i < n;
i+= str) {
106 z[
i] = beta * z[
i] + ni[
i];
107 q[
i] = beta * q[
i] + mi[
i];
108 s[
i] = beta * s[
i] +
w[
i];
109 r[
i] = r[
i] - alpha * s[
i];
110 u2[
i] = u1[
i] - alpha * q[
i];
111 w[
i] =
w[
i] - alpha * z[
i];
112 tmp1 = tmp1 + r[
i] * mult[
i] * u2[
i];
113 tmp2 = tmp2 +
w[
i] * mult[
i] * u2[
i];
114 tmp3 = tmp3 + r[
i] * mult[
i] * r[
i];
128 tmp1 = (threadIdx.x < blockDim.x /
NEKO_WAVE_SIZE) ? buf1[lane] : 0;
129 tmp2 = (threadIdx.x < blockDim.x /
NEKO_WAVE_SIZE) ? buf2[lane] : 0;
130 tmp3 = (threadIdx.x < blockDim.x /
NEKO_WAVE_SIZE) ? buf3[lane] : 0;
137 if (threadIdx.x == 0) {
138 buf_h1[blockIdx.x] = tmp1;
139 buf_h2[blockIdx.x] = tmp2;
140 buf_h3[blockIdx.x] = tmp3;
__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)