15 #define ZERO =0 // default: no batch/tiles
110 template<
typename ty> ty
norm(
const array& in,
float p =
af::NaN);
137 template<
typename ty> ty
dot(
const array& x,
const array& y);
139 AFAPI array
dot(
const array&x,
const array& y);
178 AFAPI array
matmul(
const array&,
const array&,
const array&);
190 AFAPI array
matmul(
const array&,
const array&,
const array&,
const array&);
228 AFAPI afError af_gemm_S(
char TRANSA,
char TRANSB,
int M,
int N,
int K,
float ALPHA,
const float *d_A,
int LDA,
const float *d_B,
int LDB,
float BETA,
float *d_C,
int LDC,
unsigned batch_A
ZERO,
unsigned batch_B ZERO);
230 AFAPI afError af_gemm_D(
char TRANSA,
char TRANSB,
int M,
int N,
int K,
double ALPHA,
const double *d_A,
int LDA,
const double *d_B,
int LDB,
double BETA,
double *d_C,
int LDC,
unsigned batch_A
ZERO,
unsigned batch_B ZERO);
232 AFAPI afError af_gemm_C(
char TRANSA,
char TRANSB,
int M,
int N,
int K,
cfloat ALPHA,
const cfloat *d_A,
int LDA,
const cfloat *d_B,
int LDB,
cfloat BETA,
cfloat *d_C,
int LDC,
unsigned batch_A
ZERO,
unsigned batch_B ZERO);
234 AFAPI afError af_gemm_Z(
char TRANSA,
char TRANSB,
int M,
int N,
int K,
cdouble ALPHA,
const cdouble *d_A,
int LDA,
const cdouble *d_B,
int LDB,
cdouble BETA,
cdouble *d_C,
int LDC,
unsigned batch_A
ZERO,
unsigned batch_B ZERO);
237 float *d_C,
int M,
int N,
int K,
238 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
240 float *d_C,
int M,
int N,
int K,
241 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
243 float *d_C,
int M,
int N,
int K,
244 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
246 double *d_C,
int M,
int N,
int K,
247 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
249 cfloat *d_C,
int M,
int N,
int K,
250 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
252 cfloat *d_C,
int M,
int N,
int K,
253 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
255 cfloat *d_C,
int M,
int N,
int K,
256 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
259 int K,
unsigned batch_A
ZERO,
260 unsigned batch_B ZERO);
262 cfloat *d_C,
int M,
int N,
int K,
263 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
265 cfloat *d_C,
int M,
int N,
int K,
266 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
268 cfloat *d_C,
int M,
int N,
int K,
269 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
272 int K,
unsigned batch_A
ZERO,
273 unsigned batch_B ZERO);
275 cfloat *d_C,
int M,
int N,
int K,
276 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
280 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
283 cfloat *d_C,
int M,
int N,
int K,
284 unsigned batch_A
ZERO,
unsigned batch_B ZERO);
288 int K,
unsigned batch_A
ZERO,
289 unsigned batch_B ZERO);
309 unsigned numel,
const float* d_src);
312 unsigned numel,
const double* d_src);
316 unsigned ndims,
const unsigned* dims,
317 const float* d_src,
int dim);
320 unsigned ndims,
const unsigned* dims,
321 const double* d_src,
int dim);
afError af_gemm_D(char TRANSA, char TRANSB, int M, int N, int K, double ALPHA, const double *d_A, int LDA, const double *d_B, int LDB, double BETA, double *d_C, int LDC, unsigned batch_A=0, unsigned batch_B=0)
Double precision, Real matrix multiply.
#define ZERO
Definition: blas.h:15
afError af_matmul_ZD(const cdouble *d_A, const double *d_B, cdouble *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_gemm_S(char TRANSA, char TRANSB, int M, int N, int K, float ALPHA, const float *d_A, int LDA, const float *d_B, int LDB, float BETA, float *d_C, int LDC, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_ZC(const cdouble *d_A, const cfloat *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_ZS(const cdouble *d_A, const float *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_CS(const cfloat *d_A, const float *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_norm_vector_D(double *h_dst, unsigned numel, const double *d_src)
norm The value of a double precision vector
afError af_matmul_SD(const float *d_A, const double *d_B, float *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
af_matprop_t
Definition: defines.h:4
afError af_matmul_DD(const double *d_A, const double *d_B, double *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_CZ(const cfloat *d_A, const cdouble *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_dot_Z(cdouble *h_res, unsigned len, const cdouble *d_A, const cdouble *d_B)
afError
Definition: defines.h:10
afError af_dot_D(double *h_res, unsigned len, const double *d_A, const double *d_B)
cuDoubleComplex cdouble
Definition: defines.h:109
const double NaN
representation for not-a-number
afError af_matmul_SS(const float *d_A, const float *d_B, float *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
Mixed precision, mixed complexity matrix multiply.
afError af_matmul_SC(const float *d_A, const cfloat *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_gemm_Z(char TRANSA, char TRANSB, int M, int N, int K, cdouble ALPHA, const cdouble *d_A, int LDA, const cdouble *d_B, int LDB, cdouble BETA, cdouble *d_C, int LDC, unsigned batch_A=0, unsigned batch_B=0)
Double precision, Complex matrix multiply.
afError af_norm_D(double *d_dst, unsigned ndims, const unsigned *dims, const double *d_src, int dim)
norm the value along a dimension in double precision matrix
afError af_matmul_DS(const double *d_A, const float *d_B, float *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_SZ(const float *d_A, const cdouble *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_ZZ(const cdouble *d_A, const cdouble *d_B, cdouble *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_norm_vector_S(float *h_dst, unsigned numel, const float *d_src)
afError af_gemm_C(char TRANSA, char TRANSB, int M, int N, int K, cfloat ALPHA, const cfloat *d_A, int LDA, const cfloat *d_B, int LDB, cfloat BETA, cfloat *d_C, int LDC, unsigned batch_A=0, unsigned batch_B=0)
Single precision, Complex matrix multiply.
afError af_dot_S(float *h_res, unsigned len, const float *d_A, const float *d_B)
afError af_matmul_CC(const cfloat *d_A, const cfloat *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
#define AFAPI
Definition: defines.h:45
afError af_matmul_DZ(const double *d_A, const cdouble *d_B, cdouble *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
afError af_matmul_DC(const double *d_A, const cfloat *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
array matmul(const array &, const array &, af_matprop_t=af_none, af_matprop_t=af_none)
Multiply two arrays together.
afError af_matmul_CD(const cfloat *d_A, const double *d_B, cfloat *d_C, int M, int N, int K, unsigned batch_A=0, unsigned batch_B=0)
ty norm(const array &in, float p=af::NaN)
Matrix or vector norm.
afError af_dot_C(cfloat *h_res, unsigned len, const cfloat *d_A, const cfloat *d_B)
cuFloatComplex cfloat
Definition: defines.h:108
Default.
Definition: defines.h:5
ty dot(const array &x, const array &y)
Scalar dot product between two vectors.
afError af_norm_S(float *d_dst, unsigned ndims, const unsigned *dims, const float *d_src, int dim)
norm the value along a dimension in single precision matrix