18
19
20
24#include "../tools.hpp"
27#include "../../exceptions.hpp"
30namespace nda::blas::device {
32 void axpy(
int N,
double alpha,
const double *x,
int incx,
double *Y,
int incy);
33 void axpy(
int N, dcomplex alpha,
const dcomplex *x,
int incx, dcomplex *Y,
int incy);
35 void copy(
int N,
const double *x,
int incx,
double *Y,
int incy);
36 void copy(
int N,
const dcomplex *x,
int incx, dcomplex *Y,
int incy);
38 double dot(
int M,
const double *x,
int incx,
const double *Y,
int incy);
39 dcomplex dot(
int M,
const dcomplex *x,
int incx,
const dcomplex *Y,
int incy);
40 dcomplex dotc(
int M,
const dcomplex *x,
int incx,
const dcomplex *Y,
int incy);
42 void gemm(
char op_a,
char op_b,
int M,
int N,
int K,
double alpha,
const double *A,
int LDA,
const double *B,
int LDB,
double beta,
double *C,
44 void gemm(
char op_a,
char op_b,
int M,
int N,
int K, dcomplex alpha,
const dcomplex *A,
int LDA,
const dcomplex *B,
int LDB, dcomplex beta,
45 dcomplex *C,
int LDC);
47 void gemm_batch(
char op_a,
char op_b,
int M,
int N,
int K,
double alpha,
const double **A,
int LDA,
const double **B,
int LDB,
double beta,
48 double **C,
int LDC,
int batch_count);
49 void gemm_batch(
char op_a,
char op_b,
int M,
int N,
int K, dcomplex alpha,
const dcomplex **A,
int LDA,
const dcomplex **B,
int LDB, dcomplex beta,
50 dcomplex **C,
int LDC,
int batch_count);
53 void gemm_vbatch(
char op_a,
char op_b,
int *M,
int *N,
int *K,
double alpha,
const double **A,
int *LDA,
const double **B,
int *LDB,
double beta,
54 double **C,
int *LDC,
int batch_count);
55 void gemm_vbatch(
char op_a,
char op_b,
int *M,
int *N,
int *K, dcomplex alpha,
const dcomplex **A,
int *LDA,
const dcomplex **B,
int *LDB,
56 dcomplex beta, dcomplex **C,
int *LDC,
int batch_count);
58 inline void gemm_vbatch(
char,
char,
int,
int,
int,
double,
const double **,
int *,
const double **,
int *,
double,
double **,
int *,
int) {
59 NDA_RUNTIME_ERROR <<
"nda::blas::device::gemmv_batch requires Magma [https://icl.cs.utk.edu/magma/]. Configure nda with -DUse_Magma=ON";
61 inline void gemm_vbatch(
char,
char,
int *,
int *,
int *, dcomplex,
const dcomplex **,
int *,
const dcomplex **,
int *, dcomplex, dcomplex **,
int *,
63 NDA_RUNTIME_ERROR <<
"nda::blas::device::gemmv_batch requires Magma [https://icl.cs.utk.edu/magma/]. Configure nda with -DUse_Magma=ON";
67 void gemm_batch_strided(
char op_a,
char op_b,
int M,
int N,
int K,
double alpha,
const double *A,
int LDA,
int strideA,
const double *B,
int LDB,
68 int strideB,
double beta,
double *C,
int LDC,
int strideC,
int batch_count);
69 void gemm_batch_strided(
char op_a,
char op_b,
int M,
int N,
int K, dcomplex alpha,
const dcomplex *A,
int LDA,
int strideA,
const dcomplex *B,
70 int LDB,
int srideB, dcomplex beta, dcomplex *C,
int LDC,
int strideC,
int batch_count);
72 void gemv(
char op,
int M,
int N,
double alpha,
const double *A,
int LDA,
const double *x,
int incx,
double beta,
double *Y,
int incy);
73 void gemv(
char op,
int M,
int N, dcomplex alpha,
const dcomplex *A,
int LDA,
const dcomplex *x,
int incx, dcomplex beta, dcomplex *Y,
int incy);
75 void ger(
int M,
int N,
double alpha,
const double *x,
int incx,
const double *Y,
int incy,
double *A,
int LDA);
76 void ger(
int M,
int N, dcomplex alpha,
const dcomplex *x,
int incx,
const dcomplex *Y,
int incy, dcomplex *A,
int LDA);
78 void scal(
int M,
double alpha,
double *x,
int incx);
79 void scal(
int M, dcomplex alpha, dcomplex *x,
int incx);
81 void swap(
int N,
double *x,
int incx,
double *Y,
int incy);
82 void swap(
int N, dcomplex *x,
int incx, dcomplex *Y,
int incy);
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR