35#include <hip/hip_runtime.h>
46 const bool zero_initial,
48 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
49 const int str = blockDim.x * gridDim.x;
51 for (
int i = idx;
i < n;
i += str) {
52 const real rt = f[
i] - (!zero_initial ?
w[
i] : 0.0);
53 const real dt = rt * inv_thet;
69 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
70 const int str = blockDim.x * gridDim.x;
72 for (
int i = idx;
i < n;
i += str) {
74 const real dt = tmp1 * d[
i] + tmp2 * rt;
87 real *inv_thet,
int *n,
bool *zero_initial,
89 const dim3 nthrds(1024, 1, 1);
90 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
93 nblcks, nthrds, 0, strm, (
real *) r, (
real *) f,
95 *inv_thet, *zero_initial, *n);
106 const dim3 nthrds(1024, 1, 1);
107 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
110 nblcks, nthrds, 0, strm, (
real *) r,
__global__ void amg_cheby_solve_part2(T *__restrict__ r, T *__restrict__ w, T *__restrict__ d, T *__restrict__ x, const T tmp1, const T tmp2, const int n)
__global__ void amg_cheby_solve_part1(T *__restrict__ r, T *__restrict__ f, T *__restrict__ w, T *__restrict__ x, T *__restrict__ d, const T inv_thet, const bool zero_initial, const int n)
void hip_amg_cheby_solve_part2(void *r, void *w, void *d, void *x, real *tmp1, real *tmp2, int *n, hipStream_t strm)
__global__ void amg_cheby_solve_part2(T *__restrict__ r, T *__restrict__ w, T *__restrict__ d, T *__restrict__ x, const T tmp1, const T tmp2, const int n)
void hip_amg_cheby_solve_part1(void *r, void *f, void *w, void *x, void *d, real *inv_thet, int *n, bool *zero_initial, hipStream_t strm)
__global__ void amg_cheby_solve_part1(T *__restrict__ r, T *__restrict__ f, T *__restrict__ w, T *__restrict__ x, T *__restrict__ d, const T inv_thet, const bool zero_initial, const int n)
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__global__ void const T *__restrict__ x
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dt