36#include <hip/hip_runtime.h>
47 void *G22,
void *G23,
void *G33,
54 const dim3 nthrds(1024, 1, 1);
55 const dim3 nblcks((*nel), 1, 1);
60 HIP_KERNEL_NAME(coef_generate_geo_kernel<real, LX, 1024>), \
61 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue, \
62 (real *) G11, (real *) G12, (real *) G13, \
63 (real *) G22, (real *) G23, (real *) G33, \
64 (real *) drdx, (real *) drdy, (real *) drdz, \
65 (real *) dsdx, (real *) dsdy, (real *) dsdz, \
66 (real *) dtdx, (real *) dtdy, (real *) dtdz, \
67 (real *) jacinv, (real *) w3, *gdim); \
68 HIP_CHECK(hipGetLastError()); \
89 fprintf(stderr, __FILE__
": size not supported: %d\n", *lx);
101 void *dxdr,
void *dydr,
void *dzdr,
102 void *dxds,
void *dyds,
void *dzds,
103 void *dxdt,
void *dydt,
void *dzdt,
104 void *
dx,
void *
dy,
void *
dz,
105 void *
x,
void *y,
void *z,
109 const int n = (*nel) * (*lx) * (*lx) * (*lx);
110 const dim3 nthrds(1024, 1, 1);
111 const dim3 nblcks_dxyz((*nel), 1, 1);
112 const dim3 nblcks_drst((n + 1024 - 1)/ 1024, 1, 1);
114#define DXYZDRST_CASE(LX) \
116 hipLaunchKernelGGL( \
117 HIP_KERNEL_NAME(coef_generate_dxyz_kernel<real, LX, 1024>), \
118 nblcks_dxyz, nthrds, 0, (hipStream_t) glb_cmd_queue, \
119 (real *) dxdr, (real *) dydr, (real *) dzdr, \
120 (real *) dxds, (real *) dyds, (real *) dzds, \
121 (real *) dxdt, (real *) dydt, (real *) dzdt, \
122 (real *) dx, (real *) dy, (real *) dz, \
123 (real *) x, (real *) y, (real *) z); \
124 HIP_CHECK(hipGetLastError()); \
145 fprintf(stderr, __FILE__
": size not supported: %d\n", *lx);
167 void *
w3,
int *lxyz,
int *nel) {
169 int n = (*lxyz) * (*nel);
170 const dim3 nthrds(1024, 1, 1);
171 const dim3 nblcks((n + 1024 - 1)/ 1024, 1, 1);
186 void *nx,
void *ny,
void *nz,
187 void *dxdr,
void *dydr,
void *dzdr,
188 void *dxds,
void *dyds,
void *dzds,
189 void *dxdt,
void *dydt,
void *dzdt,
190 void *wx,
void *wy,
void *wz,
191 int *lx,
int *nel,
real eps) {
193 const dim3 nblcks((*nel), 1, 1);
194 const dim3 nthrds(1024, 1, 1);
196#define AREA_CASE(LX) \
198 hipLaunchKernelGGL( \
199 HIP_KERNEL_NAME(coef_generate_area_and_normal_kernel<real, LX>), \
200 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue, \
201 (real *) area, (real *) nx, (real *) ny, (real *) nz, \
202 (real *) dxdr, (real *) dydr, (real *) dzdr, \
203 (real *) dxds, (real *) dyds, (real *) dzds, \
204 (real *) dxdt, (real *) dydt, (real *) dzdt, \
205 (real *) wx, (real *) wy, (real *) wz, eps); \
206 HIP_CHECK(hipGetLastError()); \
227 fprintf(stderr, __FILE__
": size not supported: %d\n", *lx);
237 void *nx,
void *ny,
void *nz,
238 void *i_idx,
void *j_idx,
void *k_idx,
239 void *e_idx,
void *facet,
int *lx,
int *n) {
245 const dim3 nthrds(1024, 1, 1);
246 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
250 (
real *) normal_x, (
real *) normal_y,
252 (
real *) nz, (
int *) i_idx, (
int *) j_idx,
253 (
int *) k_idx, (
int *) e_idx, (
int *) facet,
void hip_coef_generate_geo(void *G11, void *G12, void *G13, void *G22, void *G23, void *G33, void *drdx, void *drdy, void *drdz, void *dsdx, void *dsdy, void *dsdz, void *dtdx, void *dtdy, void *dtdz, void *jacinv, void *w3, int *nel, int *lx, int *gdim)
void hip_coef_generate_dxyzdrst(void *drdx, void *drdy, void *drdz, void *dsdx, void *dsdy, void *dsdz, void *dtdx, void *dtdy, void *dtdz, void *dxdr, void *dydr, void *dzdr, void *dxds, void *dyds, void *dzds, void *dxdt, void *dydt, void *dzdt, void *dx, void *dy, void *dz, void *x, void *y, void *z, void *jacinv, void *jac, int *lx, int *nel)
void hip_coef_generate_area_and_normal(void *area, void *nx, void *ny, void *nz, void *dxdr, void *dydr, void *dzdr, void *dxds, void *dyds, void *dzds, void *dxdt, void *dydt, void *dzdt, void *wx, void *wy, void *wz, int *lx, int *nel, real eps)
void hip_coef_generate_mass(void *B, void *Binv, void *jac, void *w3, int *lxyz, int *nel)
void hip_coef_get_normal(void *normal_x, void *normal_y, void *normal_z, void *nx, void *ny, void *nz, void *i_idx, void *j_idx, void *k_idx, void *e_idx, void *facet, int *lx, int *n)
#define DXYZDRST_CASE(LX)
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dz
__global__ void const T *__restrict__ const T *__restrict__ dx
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ dy
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dtdy
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dtdx
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dtdz
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ jacinv
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dsdz
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ drdz
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ drdx
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dsdx
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dsdy
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ drdy
__global__ void const T *__restrict__ x
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w3
__global__ void coef_get_normal_kernel(T *__restrict__ normal_x, T *__restrict__ normal_y, T *__restrict__ normal_z, const T *__restrict__ nx, const T *__restrict__ ny, const T *__restrict__ nz, const int *__restrict__ i_idx, const int *__restrict__ j_idx, const int *__restrict__ k_idx, const int *__restrict__ e_idx, const int *__restrict__ facet_idx, const int lx, const int n)
__global__ void coef_generate_drst_kernel(T *__restrict__ jac, T *__restrict__ jacinv, T *__restrict__ drdx, T *__restrict__ drdy, T *__restrict__ drdz, T *__restrict__ dsdx, T *__restrict__ dsdy, T *__restrict__ dsdz, T *__restrict__ dtdx, T *__restrict__ dtdy, T *__restrict__ dtdz, const T *__restrict__ dxdr, const T *__restrict__ dydr, const T *__restrict__ dzdr, const T *__restrict__ dxds, const T *__restrict__ dyds, const T *__restrict__ dzds, const T *__restrict__ dxdt, const T *__restrict__ dydt, const T *__restrict__ dzdt, const int n)
__global__ void coef_generate_mass_kernel(T *__restrict__ B, T *__restrict__ Binv, const T *__restrict__ jac, const T *__restrict__ w3, int lxyz, int nel)