QUDA  v0.7.0
A library for QCD on GPUs
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
blas_magma.h
Go to the documentation of this file.
1 #ifndef _BLAS_MAGMA_H
2 #define _BLAS_MAGMA_H
3 
4 #include <cuda.h>
5 #include <cuda_runtime.h>
6 #include <string>
7 #include <complex>
8 #include <cuComplex.h>
9 #include <stdio.h>
10 
11 //MAGMA library interface
12 //required for (incremental) EigCG solver
13 
15  private:
16 
17  //problem sizes:
18  int m;
19  int nev;
20  int prec;
21  int ldm;//(may include padding)
22 
23  //general magma library parameters:
24  int info;
25 
26  bool init;
27  bool alloc;
28 
29  //magma params/objects:
30  int llwork;
31  int lrwork;
32  int liwork;
33 
34  int sideLR;
35 
36  int htsize;//MIN(l,k)-number of Householder reflectors, but we always have k <= MIN(m,n)
37  int dtsize;//in general: MIN(m,k) for side = 'L' and MIN(n,k) for side = 'R'
38 
39  int lwork_max;
40 
41  void *W;
42  void *W2;
43  void *hTau;
44  void *dTau;
45 
46  void *lwork;
47  void *rwork;
48  int *iwork;
49 
50  public:
51 
52  BlasMagmaArgs() : prec(8), info(-1), init(true), alloc(false) { }
53 
54  BlasMagmaArgs(const int prec);
55 
56  BlasMagmaArgs(const int m, const int nev, const int ldm, const int prec);
57 
58  BlasMagmaArgs(const int m, const int ldm, const int prec);
59 
61 
62  //Initialization methods:
63  static void OpenMagma();
64  //
65  static void CloseMagma();
66 
67  //Collection of methods for EigCG solver:
68  void MagmaHEEVD(void *dTvecm, void *hTvalm, const int problem_size, bool host = false);
69  //
70  int MagmaORTH_2nev(void *dTvecm, void *dTm);
71  //
72  void RestartV(void *dV, const int vld, const int vlen, const int vprec, void *dTevecm, void *dTm);
73 
74  //Collection of methods used for the initial guess vector deflation:
75 
76  //this accepts host routines, and employ either CPU or GPU, depending on problem size etc.
77  void SolveProjMatrix(void* rhs, const int ldn, const int n, void* H, const int ldH);
78 
79  //GPU version of the above
80  void SolveGPUProjMatrix(void* rhs, const int ldn, const int n, void* H, const int ldH);
81 
82  //Spinor matrix vector product:
83  void SpinorMatVec(void *spinorOut, const void *spinorSetIn, const int sld, const int slen, const void *vec, const int vlen);
84  };
85 
86 
87 #endif // _BLAS_MAGMA_H
void RestartV(void *dV, const int vld, const int vlen, const int vprec, void *dTevecm, void *dTm)
Definition: blas_magma.cpp:293
void SolveProjMatrix(void *rhs, const int ldn, const int n, void *H, const int ldH)
Definition: blas_magma.cpp:398
int MagmaORTH_2nev(void *dTvecm, void *dTm)
Definition: blas_magma.cpp:250
void SolveGPUProjMatrix(void *rhs, const int ldn, const int n, void *H, const int ldH)
Definition: blas_magma.cpp:428
void SpinorMatVec(void *spinorOut, const void *spinorSetIn, const int sld, const int slen, const void *vec, const int vlen)
Definition: blas_magma.cpp:459
static void CloseMagma()
Definition: blas_magma.cpp:58
cpuColorSpinorField * spinorOut
Definition: dslash_test.cpp:40
void MagmaHEEVD(void *dTvecm, void *hTvalm, const int problem_size, bool host=false)
Definition: blas_magma.cpp:203
static void OpenMagma()
Definition: blas_magma.cpp:39