QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Functions | Variables
dslash_ctest.cpp File Reference
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <quda.h>
#include <quda_internal.h>
#include <dirac_quda.h>
#include <dslash_quda.h>
#include <invert_quda.h>
#include <util_quda.h>
#include <blas_quda.h>
#include <test_util.h>
#include <dslash_util.h>
#include <wilson_dslash_reference.h>
#include <domain_wall_dslash_reference.h>
#include "misc.h"
#include <qio_field.h>
#include <gtest/gtest.h>
Include dependency graph for dslash_ctest.cpp:

Go to the source code of this file.

Classes

struct  DslashTime
 
class  DslashTest
 

Macros

#define MAX(a, b)   ((a)>(b)?(a):(b))
 

Functions

void usage (char **)
 
double getTolerance (QudaPrecision prec)
 
void init (int precision, QudaReconstructType link_recon)
 
void end ()
 
DslashTime dslashCUDA (int niter)
 
void dslashRef ()
 
void display_test_info (int precision, QudaReconstructType link_recon)
 
 TEST_P (DslashTest, verify)
 
 TEST_P (DslashTest, benchmark)
 
int main (int argc, char **argv)
 
std::string getdslashtestname (testing::TestParamInfo<::testing::tuple< int, int, int >> param)
 
 INSTANTIATE_TEST_SUITE_P (QUDA, DslashTest, Combine(Range(0, 4), ::testing::Values(QUDA_RECONSTRUCT_NO, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_8), ::testing::Values(0)), getdslashtestname)
 

Variables

const QudaParity parity = QUDA_EVEN_PARITY
 
const int transfer = 0
 
double kappa5
 
QudaPrecision cpu_prec = QUDA_DOUBLE_PRECISION
 
QudaPrecision cuda_prec
 
QudaGaugeParam gauge_param
 
QudaInvertParam inv_param
 
cpuColorSpinorFieldspinor
 
cpuColorSpinorFieldspinorOut
 
cpuColorSpinorFieldspinorRef
 
cpuColorSpinorFieldspinorTmp
 
cudaColorSpinorFieldcudaSpinor
 
cudaColorSpinorFieldcudaSpinorOut
 
cudaColorSpinorFieldtmp1 =0
 
cudaColorSpinorFieldtmp2 =0
 
void * hostGauge [4]
 
void * hostClover
 
void * hostCloverInv
 
Diracdirac = NULL
 
DiracMobiusPCdirac_mdwf = NULL
 
DiracDomainWall4DPCdirac_4dpc = NULL
 
int test_type
 
QudaDslashType dslash_type
 
QudaTwistFlavorType twist_flavor
 
QudaMatPCType matpc_type
 
int device
 
int xdim
 
int ydim
 
int zdim
 
int tdim
 
int Lsdim
 
int gridsize_from_cmdline []
 
QudaDagType dagger
 
QudaDagType not_dagger
 
bool compute_clover
 
double clover_coeff
 
bool verify_results
 
int niter
 
char latfile []
 
double mass
 
double mu
 
double epsilon
 
QudaVerbosity verbosity
 
const char * prec_str [] = {"quarter", "half", "single", "double"}
 
const char * recon_str [] = {"r18", "r12", "r8"}
 

Macro Definition Documentation

◆ MAX

#define MAX (   a,
 
)    ((a)>(b)?(a):(b))

Definition at line 24 of file dslash_ctest.cpp.

Referenced by init().

Function Documentation

◆ display_test_info()

void display_test_info ( int  precision,
QudaReconstructType  link_recon 
)

Definition at line 961 of file dslash_ctest.cpp.

References dagger, dslash_type, get_dslash_str(), get_matpc_str(), get_prec_str(), get_recon_str(), getPrecision(), Lsdim, matpc_type, niter, prec, printfQuda, tdim, test_type, xdim, ydim, and zdim.

Referenced by DslashTest::SetUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dslashCUDA()

DslashTime dslashCUDA ( int  niter)

◆ dslashRef()

void dslashRef ( )

◆ end()

void end ( void  )

Definition at line 428 of file dslash_ctest.cpp.

References commDimPartitionedReset(), cudaSpinor, cudaSpinorOut, dirac, dslash_type, freeGaugeQuda(), hostClover, hostCloverInv, hostGauge, printfQuda, QUDA_CLOVER_WILSON_DSLASH, QUDA_TWISTED_CLOVER_DSLASH, spinor, spinorOut, spinorRef, spinorTmp, tmp1, tmp2, and transfer.

Referenced by dslashCUDA(), and DslashTest::TearDown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getdslashtestname()

std::string getdslashtestname ( testing::TestParamInfo<::testing::tuple< int, int, int >>  param)

Definition at line 1118 of file dslash_ctest.cpp.

References INSTANTIATE_TEST_SUITE_P(), param, prec, prec_str, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_8, and QUDA_RECONSTRUCT_NO.

Here is the call graph for this function:

◆ getTolerance()

double getTolerance ( QudaPrecision  prec)

Definition at line 88 of file dslash_ctest.cpp.

References QUDA_DOUBLE_PRECISION, QUDA_HALF_PRECISION, QUDA_INVALID_PRECISION, QUDA_QUARTER_PRECISION, and QUDA_SINGLE_PRECISION.

Referenced by TEST_P().

Here is the caller graph for this function:

◆ init()

void init ( int  precision,
QudaReconstructType  link_recon 
)

Definition at line 100 of file dslash_ctest.cpp.

References QudaGaugeParam_s::anisotropy, QudaInvertParam_s::b_5, QudaInvertParam_s::c_5, QudaInvertParam_s::cl_pad, clover_coeff, QudaInvertParam_s::clover_coeff, QudaInvertParam_s::clover_cpu_prec, QudaInvertParam_s::clover_cuda_prec, QudaInvertParam_s::clover_cuda_prec_precondition, QudaInvertParam_s::clover_cuda_prec_refinement_sloppy, QudaInvertParam_s::clover_cuda_prec_sloppy, QudaInvertParam_s::clover_order, cloverSiteSize, compute_clover, QudaInvertParam_s::compute_clover, QudaInvertParam_s::compute_clover_inverse, construct_clover_field(), construct_gauge_field(), cpu_prec, QudaGaugeParam_s::cpu_prec, QudaInvertParam_s::cpu_prec, quda::ColorSpinorParam::create, quda::Dirac::create(), csParam, cuda_prec, QudaGaugeParam_s::cuda_prec, QudaInvertParam_s::cuda_prec, QudaGaugeParam_s::cuda_prec_sloppy, dagger, QudaInvertParam_s::dagger, QudaInvertParam_s::dirac_order, dslash_type, QudaInvertParam_s::dslash_type, dw_setDims(), epsilon, QudaInvertParam_s::epsilon, errorQuda, quda::ColorSpinorParam::fieldOrder, QudaGaugeParam_s::ga_pad, QudaInvertParam_s::gamma_basis, quda::ColorSpinorParam::gammaBasis, QudaGaugeParam_s::gauge_fix, QudaGaugeParam_s::gauge_order, gaugeSiteSize, getPrecision(), hostClover, hostCloverInv, hostGauge, QudaInvertParam_s::input_location, QudaInvertParam_s::kappa, kappa5, link_recon, loadCloverQuda(), loadGaugeQuda(), Ls, QudaInvertParam_s::Ls, Lsdim, QudaInvertParam_s::m5, mass, QudaInvertParam_s::mass, matpc_type, QudaInvertParam_s::matpc_type, MAX, mu, QudaInvertParam_s::mu, quda::ColorSpinorParam::nColor, quda::LatticeFieldParam::nDim, newQudaGaugeParam(), newQudaInvertParam(), quda::norm(), not_dagger, quda::ColorSpinorParam::nSpin, QudaInvertParam_s::output_location, quda::LatticeFieldParam::pad, quda::ColorSpinorParam::pc_type, quda::LatticeFieldParam::Precision(), printfQuda, QUDA_4D_PC, QUDA_5D_PC, QUDA_ANTI_PERIODIC_T, QUDA_ASQTAD_DSLASH, QUDA_CLOVER_WILSON_DSLASH, QUDA_CPU_FIELD_LOCATION, QUDA_DEGRAND_ROSSI_GAMMA_BASIS, QUDA_DIRAC_ORDER, QUDA_DIRECT_PC_SOLVE, QUDA_DIRECT_SOLVE, QUDA_DOMAIN_WALL_4D_DSLASH, QUDA_DOMAIN_WALL_DSLASH, QUDA_DOUBLE_PRECISION, QUDA_EVEN_ODD_SITE_ORDER, QUDA_FLOAT2_FIELD_ORDER, QUDA_FLOAT4_FIELD_ORDER, QUDA_FULL_SITE_SUBSET, QUDA_GAUGE_FIXED_NO, QUDA_MAT_SOLUTION, QUDA_MATDAG_MAT_SOLUTION, QUDA_MATPC_SOLUTION, QUDA_MATPCDAG_MATPC_SOLUTION, QUDA_MOBIUS_DWF_DSLASH, QUDA_PACKED_CLOVER_ORDER, QUDA_PARITY_SITE_SUBSET, QUDA_QDP_GAUGE_ORDER, QUDA_RANDOM_SOURCE, QUDA_SPACE_SPIN_COLOR_FIELD_ORDER, QUDA_STAGGERED_DSLASH, QUDA_TWIST_NONDEG_DOUBLET, QUDA_TWIST_SINGLET, QUDA_TWISTED_CLOVER_DSLASH, QUDA_TWISTED_MASS_DSLASH, QUDA_UKQCD_GAMMA_BASIS, QUDA_WILSON_LINKS, QUDA_ZERO_FIELD_CREATE, QudaGaugeParam_s::reconstruct, QudaGaugeParam_s::reconstruct_sloppy, QudaInvertParam_s::return_clover, QudaInvertParam_s::return_clover_inverse, setDims(), quda::setDiracParam(), quda::ColorSpinorParam::setPrecision(), setSpinorSiteSize(), setVerbosity(), quda::ColorSpinorParam::siteOrder, quda::LatticeFieldParam::siteSubset, QudaInvertParam_s::solution_type, QudaInvertParam_s::solve_type, quda::cpuColorSpinorField::Source(), QudaInvertParam_s::sp_pad, spinor, QudaGaugeParam_s::t_boundary, tdim, test_type, tmp1, quda::DiracParam::tmp1, tmp2, quda::DiracParam::tmp2, transfer, twist_flavor, QudaInvertParam_s::twist_flavor, quda::ColorSpinorParam::twistFlavor, QudaGaugeParam_s::type, V, verbosity, QudaInvertParam_s::verbosity, QudaGaugeParam_s::X, quda::LatticeFieldParam::x, xdim, ydim, and zdim.

Referenced by DslashTest::SetUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ INSTANTIATE_TEST_SUITE_P()

INSTANTIATE_TEST_SUITE_P ( QUDA  ,
DslashTest  ,
Combine(Range(0, 4), ::testing::Values(QUDA_RECONSTRUCT_NO, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_8), ::testing::Values(0))  ,
getdslashtestname   
)

Referenced by getdslashtestname().

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1095 of file dslash_ctest.cpp.

References comm_rank(), finalizeComms(), gridsize_from_cmdline, initComms(), process_command_line_option(), and usage().

Here is the call graph for this function:

◆ TEST_P() [1/2]

TEST_P ( DslashTest  ,
verify   
)

◆ TEST_P() [2/2]

TEST_P ( DslashTest  ,
benchmark   
)

Definition at line 1068 of file dslash_ctest.cpp.

References dslashCUDA(), quda::blas::flops, quda::Dirac::Flops(), quda::ColorSpinorField::GhostBytes(), niter, printfQuda, and transfer.

Here is the call graph for this function:

◆ usage()

void usage ( char **  )

Definition at line 1783 of file test_util.cpp.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

◆ clover_coeff

double clover_coeff

Definition at line 1653 of file test_util.cpp.

Referenced by init().

◆ compute_clover

bool compute_clover

Definition at line 1654 of file test_util.cpp.

Referenced by init().

◆ cpu_prec

Definition at line 33 of file dslash_ctest.cpp.

Referenced by dslashRef(), and init().

◆ cuda_prec

QudaPrecision cuda_prec

Definition at line 34 of file dslash_ctest.cpp.

Referenced by init().

◆ cudaSpinor

cudaColorSpinorField* cudaSpinor

Definition at line 40 of file dslash_ctest.cpp.

Referenced by end().

◆ cudaSpinorOut

cudaColorSpinorField * cudaSpinorOut

Definition at line 40 of file dslash_ctest.cpp.

Referenced by end(), and TEST_P().

◆ dagger

QudaDagType dagger

Definition at line 1620 of file test_util.cpp.

Referenced by display_test_info(), dslashRef(), and init().

◆ device

int device

Definition at line 1602 of file test_util.cpp.

Referenced by DslashTest::SetUpTestCase().

◆ dirac

Dirac* dirac = NULL

Definition at line 44 of file dslash_ctest.cpp.

Referenced by end().

◆ dirac_4dpc

DiracDomainWall4DPC* dirac_4dpc = NULL

Definition at line 46 of file dslash_ctest.cpp.

◆ dirac_mdwf

DiracMobiusPC* dirac_mdwf = NULL

Definition at line 45 of file dslash_ctest.cpp.

◆ dslash_type

QudaDslashType dslash_type

Definition at line 1621 of file test_util.cpp.

Referenced by display_test_info(), dslashCUDA(), dslashRef(), end(), and init().

◆ epsilon

double epsilon

Definition at line 1649 of file test_util.cpp.

Referenced by init().

◆ gauge_param

QudaGaugeParam gauge_param

◆ gridsize_from_cmdline

int gridsize_from_cmdline[]

For MPI, the default node mapping is lexicographical with t varying fastest.

Definition at line 49 of file test_util.cpp.

Referenced by main().

◆ hostClover

void * hostClover

Definition at line 42 of file dslash_ctest.cpp.

Referenced by dslashRef(), end(), and init().

◆ hostCloverInv

void * hostCloverInv

Definition at line 42 of file dslash_ctest.cpp.

Referenced by dslashRef(), end(), and init().

◆ hostGauge

void* hostGauge[4]

Definition at line 42 of file dslash_ctest.cpp.

Referenced by dslashRef(), end(), and init().

◆ inv_param

QudaInvertParam inv_param

Definition at line 37 of file dslash_ctest.cpp.

Referenced by dslashCUDA().

◆ kappa5

double kappa5

◆ latfile

char latfile[]

Definition at line 1623 of file test_util.cpp.

◆ Lsdim

int Lsdim

Definition at line 1619 of file test_util.cpp.

Referenced by display_test_info(), dslashRef(), and init().

◆ mass

double mass

Definition at line 1646 of file test_util.cpp.

Referenced by init().

◆ matpc_type

QudaMatPCType matpc_type

Definition at line 1662 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ mu

double mu

Definition at line 1648 of file test_util.cpp.

Referenced by init().

◆ niter

int niter

Definition at line 1629 of file test_util.cpp.

Referenced by display_test_info(), dslashCUDA(), and TEST_P().

◆ not_dagger

QudaDagType not_dagger

Definition at line 66 of file dslash_ctest.cpp.

Referenced by dslashRef(), and init().

◆ parity

const QudaParity parity = QUDA_EVEN_PARITY

Definition at line 28 of file dslash_ctest.cpp.

Referenced by dslashCUDA(), and dslashRef().

◆ prec_str

const char* prec_str[] = {"quarter", "half", "single", "double"}

Definition at line 82 of file dslash_ctest.cpp.

Referenced by getdslashtestname().

◆ recon_str

const char* recon_str[] = {"r18", "r12", "r8"}

Definition at line 83 of file dslash_ctest.cpp.

◆ spinor

Definition at line 39 of file dslash_ctest.cpp.

Referenced by end(), and init().

◆ spinorOut

cpuColorSpinorField * spinorOut

Definition at line 39 of file dslash_ctest.cpp.

Referenced by end().

◆ spinorRef

cpuColorSpinorField * spinorRef

Definition at line 39 of file dslash_ctest.cpp.

Referenced by end().

◆ spinorTmp

cpuColorSpinorField * spinorTmp

Definition at line 39 of file dslash_ctest.cpp.

Referenced by end(), and main().

◆ tdim

int tdim

Definition at line 1618 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ test_type

int test_type

Definition at line 1636 of file test_util.cpp.

Referenced by display_test_info(), dslashCUDA(), dslashRef(), and init().

◆ tmp1

◆ tmp2

◆ transfer

const int transfer = 0

Definition at line 29 of file dslash_ctest.cpp.

Referenced by dslashCUDA(), end(), init(), and TEST_P().

◆ twist_flavor

QudaTwistFlavorType twist_flavor

Definition at line 1660 of file test_util.cpp.

Referenced by init().

◆ verbosity

QudaVerbosity verbosity

Definition at line 1614 of file test_util.cpp.

Referenced by init().

◆ verify_results

bool verify_results

Definition at line 1643 of file test_util.cpp.

◆ xdim

int xdim

Definition at line 1615 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ ydim

int ydim

Definition at line 1616 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ zdim

int zdim

Definition at line 1617 of file test_util.cpp.

Referenced by display_test_info(), and init().