1#ifndef __MATH_DMMA_KERNEL_H__
2#define __MATH_DMMA_KERNEL_H__
101#include <cuda_runtime.h>
123#define NEKO_DMMA_CANDIDATES 3
124#define NEKO_DMMA_NW(C) (1 << ((C) + 1))
125#define NEKO_DMMA_NTHRDS(C) dim3(32 * NEKO_DMMA_NW(C), 1, 1)
147#define NEKO_DMMA_PPA(LX) ((DMMA_P % (LX) == 0) ? (DMMA_P / (LX)) : 1)
148#define NEKO_DMMA_PACK(LX) \
149 (NEKO_DMMA_PPA(LX) * NEKO_DMMA_PPA(LX) * NEKO_DMMA_PPA(LX))
150#define NEKO_DMMA_NBLCKS(NELV, LX) \
151 dim3(((NELV) + NEKO_DMMA_PACK(LX) - 1) / NEKO_DMMA_PACK(LX), 1, 1)
157 const char *
v =
getenv(
"NEKO_DMMA_NW");
175#define NEKO_TUNE_LOG_DMMA(LX, T3) \
177 for (int c = 0; c < NEKO_DMMA_CANDIDATES; c++) { \
178 if ((T3)[c] >= NEKO_TUNE_INIT) { continue; } \
180 sprintf(lbl_, "DMMA %dw %de", \
181 NEKO_DMMA_NW(c), NEKO_DMMA_PACK(LX)); \
182 sprintf(neko_log_buf, "%-13s: %9.2f us/call", lbl_, \
183 NEKO_TUNE_US((T3)[c], iters)); \
184 log_message(neko_log_buf); \
199#ifndef NEKO_DMMA_ARCH_COMPILED
200#if defined(__CUDA_ARCH_LIST__)
243 (
prop.major == 9)) ? 1 : 0;
278template< const
int LX >
300template< const
int LX >
306#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 800) && (__CUDA_ARCH__ < 1000)
334template< const
int LX, const
int PPA >
347 const int q = p /
LX3;
348 const int r = p - q *
LX3;
349 const int i = r %
LX;
350 const int jk = r /
LX;
351 const int j =
jk %
LX;
352 const int k =
jk /
LX;
353 const int qa = q %
PPA;
373template< const
int LX >
385 const int i = p %
LX;
386 const int jk = p /
LX;
387 const int j =
jk %
LX;
388 const int k =
jk /
LX;
406template< const
int AXIS >
411 typedef nvcuda::wmma::col_major layout;
420 typedef nvcuda::wmma::row_major layout;
429 typedef nvcuda::wmma::row_major layout;
442template< const
bool TRANSPOSE >
447 typedef nvcuda::wmma::col_major layout;
455 typedef nvcuda::wmma::row_major layout;
481 namespace wmma = nvcuda::wmma;
486 view::COL_MAJOR ? wmma::mem_col_major : wmma::mem_row_major;
500 for (
int p = 0; p <
npass; p++) {
501 const int t = wf + p *
NW;
504 wmma::fragment< wmma::accumulator, DMMA_P, DMMA_P, DMMA_KS, double >
acc;
509 wmma::fill_fragment(
acc, 0.0);
515 const int koff = view::COL_MAJOR ?
l0 : (
l0 * (
int) view::LDM);
517 typename view::layout > b;
519 wmma::load_matrix_sync(b,
in + view::base(t) +
koff, view::LDM);
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__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__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const int nelv
__global__ void const T *__restrict__ x
#define NEKO_DMMA_CANDIDATES
static bool dmma_arch_compiled()
static bool dmma_vector_lx_supported()
static bool cuda_have_dmma()
static bool dmma_lx_supported()
static int neko_dmma_pin()