su2hmc
Loading...
Searching...
No Matches
matrices.h
Go to the documentation of this file.
1
6#ifndef MATRICES
7#define MATRICES
8#ifdef __NVCC__
9#include <curand.h>
10#endif
11#include <par_mpi.h>
12#include <su2hmc.h>
13#if (defined __cplusplus)
14extern "C"
15{
16#endif
35 int Dslash(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
36 Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa);
55 int Dslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
56 Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa);
74 int Hdslash(Complex *phi, Complex *r, Complex *u11t[2],unsigned int *iu,unsigned int *id,\
75 Complex *gamval, int *gamin, double *dk[2], float akappa);
93 int Hdslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
94 Complex *gamval, int *gamin, double *dk4m, double *dk4p, float akappa);
95 //Float version
114 int Dslash_f(Complex_f *phi, Complex_f *r, Complex_f *u11t, Complex_f *u12t,unsigned int *iu,unsigned int *id,\
115 Complex_f *gamval,int *gamin, float *dk[2], Complex_f jqq, float akappa);
134 int Dslashd_f(Complex_f *phi, Complex_f *r, Complex_f *u11t, Complex_f *u12t,unsigned int *iu,unsigned int *id,\
135 Complex_f *gamval,int *gamin, float *dk[2], Complex_f jqq, float akappa);
153 int Hdslash_f(Complex_f *phi, Complex_f *r, Complex_f *ut[2],unsigned int *iu,unsigned int *id,\
154 Complex_f *gamval, int *gamin, float *dk[2], float akappa);
172 int Hdslashd_f(Complex_f *phi, Complex_f *r, Complex_f *ut[2],unsigned int *iu,unsigned int *id,\
173 Complex_f *gamval,int *gamin, float *dk[2], float akappa);
174#ifdef DIAGNOSTIC
175 int Diagnostics(int istart, Complex *u11, Complex *u12,Complex *u11t, Complex *u12t, Complex_f *u11t_f, Complex_f *u12t_f,\
176 unsigned int *iu, unsigned int *id, int *hu, int *hd, double *dk4m, double *dk4p,\
177 float *dk4m_f, float *dk4p_f, int *gamin, Complex *gamval, Complex_f *gamval_f,\
178 Complex_f jqq, float akappa, float beta, double ancg);
179#endif
180
181void Transpose_z(Complex *out, const int, const int);
182void Transpose_c(Complex_f *out, const int, const int);
183void Transpose_d(double *out, const int, const int);
184void Transpose_f(float *out, const int, const int);
185void Transpose_I(int *out, const int, const int);
186void Transpose_U(unsigned int *out, const int, const int);
187
188#ifdef __NVCC__
189 //Calling Functions
190 void cuDslash(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
191 Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa,\
192 dim3 dimGrid, dim3 dimBlock);
193 void cuDslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
194 Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa,\
195 dim3 dimGrid, dim3 dimBlock);
196 void cuHdslash(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
197 Complex *gamval, int *gamin, double *dk4m, double *dk4p, float akappa,dim3 dimGrid, dim3 dimBlock);
198 void cuHdslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
199 Complex *gamval, int *gamin, double *dk4m, double *dk4p, float akappa, dim3 dimGrid, dim3 dimBlock);
200 //Float version
201 void cuDslash_f(Complex_f *phi, Complex_f *r, Complex_f *u11t_f, Complex_f *u12t_f,unsigned int *iu,unsigned int *id,\
202 Complex_f *gamval_f, int *gamin, float *dk4m_f, float *dk4p_f, Complex_f jqq_f, float akappa_f,\
203 dim3 dimGrid, dim3 dimBlock);
204 void cuDslashd_f(Complex_f *phi, Complex_f *r, Complex_f *u11t_f, Complex_f *u12t_f,unsigned int *iu,unsigned int *id,\
205 Complex_f *gamval_f,int *gamin, float *dk4m_f, float *dk4p_f, Complex_f jqq_f, float akappa_f,\
206 dim3 dimGrid, dim3 dimBlock);
207 void cuHdslash_f(Complex_f *phi, Complex_f *r, Complex_f *ut_f[2],unsigned int *iu,unsigned int *id,\
208 Complex_f *gamval_f,int *gamin, float *dk_f[2], float akappa_f,dim3 dimGrid, dim3 dimBlock);
209 void cuHdslashd_f(Complex_f *phi, Complex_f *r, Complex_f *ut_f[2],unsigned int *iu,unsigned int *id,\
210 Complex_f *gamval_f,int *gamin, float *dk_f[2], float akappa_f, dim3 dimGrid, dim3 dimBlock);
211
221 void cuTranspose_z(Complex *out, const int fast_in, const int fast_out, const dim3 dimGrid, const dim3 dimBlock);
222 void cuTranspose_c(Complex_f *out, const int fast_in, const int fast_out, const dim3 dimGrid, const dim3 dimBlock);
223 void cuTranspose_d(double *out, const int fast_in, const int fast_out, const dim3 dimGrid, const dim3 dimBlock);
224 void cuTranspose_f(float *out, const int fast_in, const int fast_out, const dim3 dimGrid, const dim3 dimBlock);
225 void cuTranspose_I(int *out, const int fast_in, const int fast_out, const dim3 dimGrid, const dim3 dimBlock);
226 void cuTranspose_U(unsigned int *out, const int fast_in, const int fast_out, const dim3 dimGrid, const dim3 dimBlock);
227#endif
228#if (defined __cplusplus)
229}
230#endif
231#ifdef __CUDACC__
232//Actual CUDA
233__global__ void cuDslash(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
234 Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa);
235__global__ void cuDslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
236 Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa);
237__global__ void cuHdslash(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
238 Complex *gamval, int *gamin, double *dk4m, double *dk4p, float akappa);
239__global__ void cuHdslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t,unsigned int *iu,unsigned int *id,\
240 Complex *gamval, int *gamin, double *dk4m, double *dk4p, float akappa);
241//Float version
242__global__ void cuDslash_f(Complex_f *phi, Complex_f *r, Complex_f *u11t, Complex_f *u12t,unsigned int *iu, unsigned int *id,\
243 __shared__ Complex_f *gamval, int *gamin, float *dk4m, float *dk4p, Complex_f jqq, float akappa);
244__global__ void cuDslashd_f(Complex_f *phi, const Complex_f *r, const Complex_f *u11t, const Complex_f *u12t,const unsigned int *iu, const unsigned int *id,\
245 __shared__ Complex_f *gamval_d, int *gamin_d, const float *dk4m, const float *dk4p, const Complex_f jqq, const float akappa);
246
247__global__ void cuHdslash_f(Complex_f *phi, const Complex_f *r, const Complex_f *u11t, const Complex_f *u12t,const unsigned int *iu, const unsigned int *id,\
248 const __shared__ Complex_f gamval[20], const __shared__ int gamin[16], const float *dk4m, const float *dk4p, const float akappa);
249__global__ void cuHdslashd_f(Complex_f *phi, const Complex_f *r, const Complex_f *u11t, const Complex_f *u12t,const unsigned int *iu, const unsigned int *id,\
250 const __shared__ Complex_f gamval[20], const __shared__ int gamin[16], const float *dk4m, const float *dk4p, const float akappa);
251template <typename T> __global__ void Transpose(T *out, const T *in, const int fast_in, const int fast_out);
252#endif
253#endif
unsigned int * hd
Down halo indices.
Definition coord.c:15
unsigned int * hu
Up halo indices.
Definition coord.c:15
int Hdslashd_f(Complex_f *phi, Complex_f *r, Complex_f *ut[2], unsigned int *iu, unsigned int *id, Complex_f *gamval, int *gamin, float *dk[2], float akappa)
Evaluates in single precision.
Definition matrices.c:855
int Dslash_f(Complex_f *phi, Complex_f *r, Complex_f *u11t, Complex_f *u12t, unsigned int *iu, unsigned int *id, Complex_f *gamval, int *gamin, float *dk[2], Complex_f jqq, float akappa)
Evaluates in single precision.
Definition matrices.c:463
int Dslash(Complex *phi, Complex *r, Complex *u11t, Complex *u12t, unsigned int *iu, unsigned int *id, Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa)
Evaluates in double precision.
Definition matrices.c:19
int Dslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t, unsigned int *iu, unsigned int *id, Complex *gamval, int *gamin, double *dk4m, double *dk4p, Complex_f jqq, float akappa)
Evaluates in double precision.
Definition matrices.c:141
int Hdslash_f(Complex_f *phi, Complex_f *r, Complex_f *ut[2], unsigned int *iu, unsigned int *id, Complex_f *gamval, int *gamin, float *dk[2], float akappa)
Evaluates in single precision.
Definition matrices.c:712
int Hdslash(Complex *phi, Complex *r, Complex *u11t[2], unsigned int *iu, unsigned int *id, Complex *gamval, int *gamin, double *dk[2], float akappa)
Evaluates in double precision.
Definition matrices.c:268
int Dslashd_f(Complex_f *phi, Complex_f *r, Complex_f *u11t, Complex_f *u12t, unsigned int *iu, unsigned int *id, Complex_f *gamval, int *gamin, float *dk[2], Complex_f jqq, float akappa)
Evaluates in single precision.
Definition matrices.c:585
int Hdslashd(Complex *phi, Complex *r, Complex *u11t, Complex *u12t, unsigned int *iu, unsigned int *id, Complex *gamval, int *gamin, double *dk4m, double *dk4p, float akappa)
Evaluates in double precision.
Definition matrices.c:359
MPI headers.
#define Complex
Double precision complex number.
Definition sizes.h:58
#define Complex_f
Single precision complex number.
Definition sizes.h:56
Function declarations for most of the routines.