QUDA v0.4.0
A library for QCD on GPUs
|
00001 00002 00003 00004 00005 __constant__ int V; 00006 00007 __constant__ int Vhx2; 00008 __constant__ int Vhx3; 00009 __constant__ int Vhx4; 00010 __constant__ int Vhx5; 00011 __constant__ int Vhx6; 00012 __constant__ int Vhx7; 00013 __constant__ int Vhx8; 00014 __constant__ int Vhx9; 00015 00016 00017 static int init_kernel_cuda_flag = 0; 00018 void 00019 init_kernel_cuda(QudaGaugeParam* param) 00020 { 00021 if (init_kernel_cuda_flag){ 00022 return; 00023 } 00024 init_kernel_cuda_flag =1; 00025 00026 int Vh = param->X[0]*param->X[1]*param->X[2]*param->X[3]/2; 00027 int V = 2*Vh; 00028 int Vhx2 = 2*Vh; 00029 int Vhx3 = 3*Vh; 00030 int Vhx4 = 4*Vh; 00031 int Vhx5 = 5*Vh; 00032 int Vhx6 = 6*Vh; 00033 int Vhx7 = 7*Vh; 00034 int Vhx8 = 8*Vh; 00035 int Vhx9 = 9*Vh; 00036 00037 cudaMemcpyToSymbol("V", &V, sizeof(int)); 00038 cudaMemcpyToSymbol("Vhx2", &Vhx2, sizeof(int)); 00039 cudaMemcpyToSymbol("Vhx3", &Vhx3, sizeof(int)); 00040 cudaMemcpyToSymbol("Vhx4", &Vhx4, sizeof(int)); 00041 cudaMemcpyToSymbol("Vhx5", &Vhx5, sizeof(int)); 00042 cudaMemcpyToSymbol("Vhx6", &Vhx6, sizeof(int)); 00043 cudaMemcpyToSymbol("Vhx7", &Vhx7, sizeof(int)); 00044 cudaMemcpyToSymbol("Vhx8", &Vhx8, sizeof(int)); 00045 cudaMemcpyToSymbol("Vhx9", &Vhx9, sizeof(int)); 00046 00047 return; 00048 }