Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
toastcuda.h
1 #ifndef __TOASTCUDA_H
2 #define __TOASTCUDA_H
3 
4 //void cuda_vecadd (float *a, float *b, float *c, int n);
5 
6 bool cuda_SetDevice (int device);
7 void cuda_EchoDeviceProperties ();
8 void cuda_Init (int device);
9 
10 struct SolverResult {
11  int it_count;
12  double rel_error;
13 };
14 
15 typedef enum {
16  CUSP_PRECON_IDENTITY,
17  CUSP_PRECON_DIAGONAL,
18  CUSP_PRECON_AINV,
19  CUSP_PRECON_SMOOTHED_AGGREGATION
20 } CuspPreconType;
21 
22 void cuda_SetCuspPrecon (CuspPreconType precontp);
23 
24 // ===========================================================================
25 // single precision
26 
27 void cuda_Ax (const float *A_val, const int *A_rowptr,
28  const int *A_colidx, int m, int n, const float *x, float *b);
29 
30 void cuda_Ax_cplx (const scomplex *A_val, const int *A_rowptr,
31  const int *A_colidx, int m, int n, const scomplex *x, scomplex *b);
32 
33 template<class T>
34 void cuda_CG (const T *A_val, const int *A_rowptr,
35  const int *A_colidx, int m, int n, const T *b, T *x,
36  T tol, int maxit, SolverResult *res = 0);
37 
38 template<class T>
39 void cuda_CG (const T *A_val, const int *A_rowptr,
40  const int *A_colidx, int m, int n, const T **b, T **x, int nrhs,
41  T tol, int maxit, SolverResult *res = 0);
42 
43 template<class T>
44 void cuda_BiCGSTAB (const T *A_val, const int *A_rowptr,
45  const int *A_colidx, int m, int n, const T *b, T *x,
46  T tol, int maxit, SolverResult *res = 0);
47 
48 template<class T>
49 void cuda_BiCGSTAB (const T *A_val, const int *A_rowptr,
50  const int *A_colidx, int m, int n, const T **b, T **x, int nrhs,
51  T tol, int maxit, SolverResult *res = 0);
52 
53 template<class T,class TR>
54 void cuda_BiCGSTAB_cplx (const T *A_val, const int *A_rowptr,
55  const int *A_colidx, int m, int n, const T *b, T *x,
56  TR tol, int maxit, SolverResult *res = 0);
57 
58 template<class T,class TR>
59 void cuda_BiCGSTAB_cplx (const T *A_val, const int *A_rowptr,
60  const int *A_colidx, int m, int n, const T **b, T **x,
61  int nrhs, TR tol, int maxit, SolverResult *res = 0);
62 
63 template<class T>
64 void Tstep_loop (int n, int nq, int nm,
65  const T *K0_val, const int *K0_rowptr, const int *K0_colidx,
66  const T *K1_val, const int *K1_rowptr, const int *K1_colidx,
67  T **qvec_val, T **mvec_val, T *proj,
68  T tol, int maxit, int nstep);
69 
70 #endif // !__TOASTCUDA_H
Definition: toastcuda.h:10