35#include <hip/hip_runtime.h>
42 ({ __typeof__ (a) _a = (a); \
43 __typeof__ (b) _b = (b); \
67 const int w1 = nu * nu * nv;
68 const int w3 = nv * nv * nv;
69 int work = (w1 >
w3) ? w1 :
w3;
71 work = ((work + 64 - 1) / 64) * 64;
72 if (work > 1024) work = 1024;
73 if (work < 64) work = 64;
81 void *A,
void *Bt,
void *Ct,
int *nel) {
84 const dim3 nblcks(*nel, 1, 1);
89 hipLaunchKernelGGL(HIP_KERNEL_NAME(tnsr3d_kernel<real, N>), \
91 (hipStream_t) glb_cmd_queue, \
94 (real *) A, (real *) Bt, (real *) Ct); \
95 HIP_CHECK(hipGetLastError()); \
116 fprintf(stderr, __FILE__
": size not supported: %d\n", n);
124 void *A,
void *Bt,
void *Ct,
int * elements,
int* n_points) {
126 const dim3 nblcks(*n_points, 1, 1);
128 int n =
max(*nu,*nv);
131 hipLaunchKernelGGL(HIP_KERNEL_NAME(tnsr3d_el_kernel<real, N>), \
133 (hipStream_t) glb_cmd_queue, \
136 (real *) A, (real *) Bt, (real *) Ct, \
137 (int *) elements, *n_points); \
138 HIP_CHECK(hipGetLastError()); \
157 fprintf(stderr, __FILE__
": size not supported: %d\n", n);
__global__ void const T *__restrict__ u
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__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
static int hip_tnsr3d_nthrds(const int nu, const int nv)
void hip_tnsr3d(void *v, int *nv, void *u, int *nu, void *A, void *Bt, void *Ct, int *nel)
void hip_tnsr3d_el_list(void *v, int *nv, void *u, int *nu, void *A, void *Bt, void *Ct, int *elements, int *n_points)