QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
quda_internal.h
Go to the documentation of this file.
1 #ifndef _QUDA_INTERNAL_H
2 #define _QUDA_INTERNAL_H
3 
4 #include <quda_cuda_api.h>
5 #include <string>
6 #include <complex>
7 #include <vector>
8 
9 #if ((defined(QMP_COMMS) || defined(MPI_COMMS)) && !defined(MULTI_GPU))
10 #error "MULTI_GPU must be enabled to use MPI or QMP"
11 #endif
12 
13 #if (!defined(QMP_COMMS) && !defined(MPI_COMMS) && defined(MULTI_GPU))
14 #error "MPI or QMP must be enabled to use MULTI_GPU"
15 #endif
16 
17 #ifdef QMP_COMMS
18 #include <qmp.h>
19 #endif
20 
21 #define TEX_ALIGN_REQ (512*2) //Fermi, factor 2 comes from even/odd
22 #define ALIGNMENT_ADJUST(n) ( (n+TEX_ALIGN_REQ-1)/TEX_ALIGN_REQ*TEX_ALIGN_REQ)
23 #include <enum_quda.h>
24 #include <quda.h>
25 #include <util_quda.h>
26 #include <malloc_quda.h>
27 #include <object.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
34  void *field;
35  };
36 
37  extern cudaDeviceProp deviceProp;
38  extern cudaStream_t *streams;
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 namespace quda {
45 
46  typedef std::complex<double> Complex;
47 
53  template< typename T > struct fixedMaxValue{ static constexpr float value = 0.0f; };
54  template<> struct fixedMaxValue<short>{ static constexpr float value = 32767.0f; };
55  template<> struct fixedMaxValue<short2>{ static constexpr float value = 32767.0f; };
56  template<> struct fixedMaxValue<short4>{ static constexpr float value = 32767.0f; };
57  template<> struct fixedMaxValue<char>{ static constexpr float value = 127.0f; };
58  template<> struct fixedMaxValue<char2>{ static constexpr float value = 127.0f; };
59  template<> struct fixedMaxValue<char4>{ static constexpr float value = 127.0f; };
60 
61  template <typename T> struct fixedInvMaxValue {
62  static constexpr float value = 3.402823e+38f;
63  };
64  template <> struct fixedInvMaxValue<short> {
65  static constexpr float value = 3.0518509476e-5f;
66  };
67  template <> struct fixedInvMaxValue<short2> {
68  static constexpr float value = 3.0518509476e-5f;
69  };
70  template <> struct fixedInvMaxValue<short4> {
71  static constexpr float value = 3.0518509476e-5f;
72  };
73  template <> struct fixedInvMaxValue<char> {
74  static constexpr float value = 7.874015748031e-3f;
75  };
76  template <> struct fixedInvMaxValue<char2> {
77  static constexpr float value = 7.874015748031e-3f;
78  };
79  template <> struct fixedInvMaxValue<char4> {
80  static constexpr float value = 7.874015748031e-3f;
81  };
82 
83  const int Nstream = 9;
84 
90 
91 }
92 
93 #include <timer.h>
94 
95 
96 #endif // _QUDA_INTERNAL_H
cudaDeviceProp deviceProp
cudaStream_t * streams
const int Nstream
Definition: quda_internal.h:83
QudaInvertParam inv_param
Definition: covdev_test.cpp:37
bool canReuseResidentGauge(QudaInvertParam *inv_param)
std::complex< double > Complex
Definition: quda_internal.h:46
Main header file for the QUDA library.