QUDA v0.4.0
A library for QCD on GPUs
|
00001 #ifndef _CLOVER_QUDA_H 00002 #define _CLOVER_QUDA_H 00003 00004 #include <quda_internal.h> 00005 #include <lattice_field.h> 00006 00007 struct CloverFieldParam : public LatticeFieldParam { 00008 00009 }; 00010 00011 class CloverField : public LatticeField { 00012 00013 protected: 00014 size_t bytes; // bytes allocated per clover full field 00015 size_t norm_bytes; // sizeof each norm full field 00016 int length; 00017 int real_length; 00018 int nColor; 00019 int nSpin; 00020 00021 public: 00022 CloverField(const CloverFieldParam ¶m, const QudaFieldLocation &location); 00023 virtual ~CloverField(); 00024 }; 00025 00026 class cudaCloverField : public CloverField { 00027 00028 private: 00029 void *clover, *even, *odd; 00030 void *norm, *evenNorm, *oddNorm; 00031 00032 void *cloverInv, *evenInv, *oddInv; 00033 void *invNorm, *evenInvNorm, *oddInvNorm; 00034 00035 void loadCPUField(void *d_clover, void *d_norm, const void *h_clover, 00036 const QudaPrecision cpu_prec, const CloverFieldOrder order); 00037 void loadParityField(void *d_clover, void *d_norm, const void *h_clover, 00038 const QudaPrecision cpu_prec, const CloverFieldOrder cpu_order); 00039 void loadFullField(void *d_even, void *d_even_norm, void *d_odd, void *d_odd_norm, 00040 const void *h_clover, const QudaPrecision cpu_prec, const CloverFieldOrder cpu_order); 00041 00042 public: 00043 cudaCloverField(const void *h_clov, const void *h_clov_inv, 00044 const QudaPrecision cpu_prec, 00045 const QudaCloverFieldOrder cpu_order, 00046 const CloverFieldParam ¶m); 00047 virtual ~cudaCloverField(); 00048 00049 00050 // TODO - improve memory efficiency for asymmetric clover? 00051 friend class DiracClover; 00052 friend class DiracCloverPC; 00053 }; 00054 00055 // this is a place holder for a future host-side clover object 00056 class cpuCloverField { 00057 00058 private: 00059 00060 public: 00061 cpuCloverField(); 00062 virtual ~cpuCloverField() = 0; 00063 }; 00064 00065 // lightweight struct used to send pointers to cuda driver code 00066 struct FullClover { 00067 void *even; 00068 void *odd; 00069 void *evenNorm; 00070 void *oddNorm; 00071 QudaPrecision precision; 00072 size_t bytes; // sizeof each clover field (per parity) 00073 size_t norm_bytes; // sizeof each norm field (per parity) 00074 }; 00075 00076 #endif // _CLOVER_QUDA_H