QUDA  0.9.0
Classes | Macros | Functions | Variables
blas_test.cu File Reference
#include <stdio.h>
#include <stdlib.h>
#include <quda_internal.h>
#include <color_spinor_field.h>
#include <blas_quda.h>
#include <test_util.h>
#include <dslash_util.h>
#include <gtest.h>
Include dependency graph for blas_test.cu:

Go to the source code of this file.

Classes

class  BlasTest
 

Macros

#define ERROR(a)   fabs(blas::norm2(*a##D) - blas::norm2(*a##H)) / blas::norm2(*a##H)
 

Functions

void usage (char **)
 
void setPrec (ColorSpinorParam &param, const QudaPrecision precision)
 
void display_test_info ()
 
bool skip_kernel (int precision, int kernel)
 
void initFields (int prec)
 
void freeFields ()
 
double benchmark (int kernel, const int niter)
 
double test (int kernel)
 
int main (int argc, char **argv)
 
 TEST_P (BlasTest, verify)
 
 TEST_P (BlasTest, benchmark)
 
std::string getblasname (testing::TestParamInfo<::testing::tuple< int, int >> param)
 
 INSTANTIATE_TEST_CASE_P (QUDA, BlasTest, Combine(Range(0, 3), Range(0, Nkernels)), getblasname)
 

Variables

int test_type
 
QudaPrecision prec
 
QudaDslashType dslash_type
 
QudaInverterType inv_type
 
int nvec
 
int device
 
int xdim
 
int ydim
 
int zdim
 
int tdim
 
int gridsize_from_cmdline []
 
int niter
 
bool verify_results
 
int Nsrc
 
int Msrc
 
QudaSolveType solve_type
 
const int Nkernels = 42
 
ColorSpinorFieldxH
 
ColorSpinorFieldyH
 
ColorSpinorFieldzH
 
ColorSpinorFieldwH
 
ColorSpinorFieldvH
 
ColorSpinorFieldhH
 
ColorSpinorFieldlH
 
ColorSpinorFieldxD
 
ColorSpinorFieldyD
 
ColorSpinorFieldzD
 
ColorSpinorFieldwD
 
ColorSpinorFieldvD
 
ColorSpinorFieldhD
 
ColorSpinorFieldlD
 
ColorSpinorFieldxmD
 
ColorSpinorFieldymD
 
ColorSpinorFieldzmD
 
std::vector< cpuColorSpinorField * > xmH
 
std::vector< cpuColorSpinorField * > ymH
 
std::vector< cpuColorSpinorField * > zmH
 
int Nspin
 
int Ncolor
 
int Nprec = 3
 
const char * prec_str [] = {"half", "single", "double"}
 
const char * names []
 

Macro Definition Documentation

◆ ERROR

#define ERROR (   a)    fabs(blas::norm2(*a##D) - blas::norm2(*a##H)) / blas::norm2(*a##H)

Definition at line 490 of file blas_test.cu.

Referenced by test().

Function Documentation

◆ benchmark()

double benchmark ( int  kernel,
const int  niter 
)

◆ display_test_info()

void display_test_info ( )

Definition at line 59 of file blas_test.cu.

References dimPartitioned(), Ncolor, Nspin, printfQuda, tdim, xdim, ydim, and zdim.

Referenced by main().

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

◆ freeFields()

void freeFields ( )

Definition at line 251 of file blas_test.cu.

References hD, hH, fused_exterior_ndeg_tm_dslash_cuda_gen::i, lD, lH, Msrc, Nsrc, vD, vH, wD, wH, xD, xH, xmD, xmH, yD, yH, ymD, ymH, zD, zH, zmD, and zmH.

Referenced by BlasTest::TearDown().

Here is the caller graph for this function:

◆ getblasname()

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

Definition at line 1075 of file blas_test.cu.

References names, param, prec, and prec_str.

◆ initFields()

void initFields ( int  prec)

◆ INSTANTIATE_TEST_CASE_P()

INSTANTIATE_TEST_CASE_P ( QUDA  ,
BlasTest  ,
Combine(Range(0, 3), Range(0, Nkernels))  ,
getblasname   
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ setPrec()

void setPrec ( ColorSpinorParam param,
const QudaPrecision  precision 
)

Definition at line 48 of file blas_test.cu.

References Nspin, param, QUDA_DOUBLE_PRECISION, QUDA_FLOAT2_FIELD_ORDER, and QUDA_FLOAT4_FIELD_ORDER.

Referenced by initFields().

Here is the caller graph for this function:

◆ skip_kernel()

bool skip_kernel ( int  precision,
int  kernel 
)

Definition at line 75 of file blas_test.cu.

References Ncolor, Nprec, Nspin, prec, QUDA_DOUBLE_PRECISION, QUDA_HALF_PRECISION, QUDA_INVALID_PRECISION, QUDA_SINGLE_PRECISION, and test_type.

Referenced by TEST_P().

Here is the caller graph for this function:

◆ test()

double test ( int  kernel)

Definition at line 492 of file blas_test.cu.

References a, fused_exterior_ndeg_tm_dslash_cuda_gen::a2, quda::abs(), abs(), quda::blas::ax(), quda::blas::axpby(), quda::blas::axpy(), quda::blas::axpyBzpcx(), quda::blas::axpyNorm(), quda::blas::axpyReDot(), quda::blas::axpyZpbx(), b, c, quda::blas::cabxpyAx(), quda::blas::cabxpyAxNorm(), quda::blas::caxpby(), quda::blas::caxpbypczpw(), quda::blas::caxpbypz(), quda::blas::caxpbypzYmbw(), quda::blas::caxpbypzYmbwcDotProductUYNormY(), quda::blas::caxpy(), quda::blas::caxpyBxpz(), quda::blas::caxpyBzpx(), quda::blas::caxpyDotzy(), quda::blas::caxpyNorm(), quda::blas::caxpyXmaz(), quda::blas::caxpyXmazNormX(), quda::blas::cDotProduct(), quda::blas::cDotProductNormA(), quda::blas::cDotProductNormB(), quda::ColorSpinorField::Component(), quda::ColorSpinorField::Components(), quda::blas::copy(), quda::blas::cxpaypbz(), d, ERROR, errorQuda, quda::exp(), fabs(), h, hD, quda::blas::HeavyQuarkResidualNorm(), hH, fused_exterior_ndeg_tm_dslash_cuda_gen::i, lD, lH, Msrc, quda::blas::mxpy(), quda::blas::norm2(), Nsrc, quda::blas::reDotProduct(), quda::sqrt(), quda::blas::tripleCGReduction(), quda::blas::tripleCGUpdate(), vD, vH, w, wD, wH, x, xD, xH, xmD, xmH, quda::blas::xmyNorm(), quda::blas::xpay(), quda::blas::xpaycDotzy(), quda::blas::xpy(), quda::blas::xpyHeavyQuarkResidualNorm(), y, yD, yH, ymD, ymH, z, zD, zH, zmD, and zmH.

Referenced by benchmark(), and TEST_P().

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

◆ TEST_P() [1/2]

TEST_P ( BlasTest  ,
verify   
)

Definition at line 1042 of file blas_test.cu.

References e, prec, skip_kernel(), test(), and tol.

Here is the call graph for this function:

◆ TEST_P() [2/2]

TEST_P ( BlasTest  ,
benchmark   
)

Definition at line 1055 of file blas_test.cu.

References benchmark(), quda::blas::bytes, e, quda::blas::flops, names, niter, prec, and printfQuda.

Here is the call graph for this function:

◆ usage()

void usage ( char **  )

Definition at line 1693 of file test_util.cpp.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

◆ device

int device

Definition at line 2238 of file CMakeCUDACompilerId.cpp1.ii.

Referenced by main().

◆ dslash_type

QudaDslashType dslash_type

Definition at line 1626 of file test_util.cpp.

Referenced by main(), and printQudaInvertParam().

◆ gridsize_from_cmdline

int gridsize_from_cmdline[]

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

Definition at line 50 of file test_util.cpp.

Referenced by main().

◆ hD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ hH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ inv_type

QudaInverterType inv_type

Definition at line 1638 of file test_util.cpp.

Referenced by main(), and printQudaInvertParam().

◆ lD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ lH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ Msrc

int Msrc

Definition at line 1629 of file test_util.cpp.

Referenced by benchmark(), freeFields(), initFields(), process_command_line_option(), and test().

◆ names

const char* names[]

Definition at line 924 of file blas_test.cu.

Referenced by getblasname(), and TEST_P().

◆ Ncolor

int Ncolor

Definition at line 46 of file blas_test.cu.

Referenced by display_test_info(), initFields(), main(), multiblasCuda(), and skip_kernel().

◆ niter

int niter

Definition at line 1630 of file test_util.cpp.

Referenced by benchmark(), and TEST_P().

◆ Nkernels

const int Nkernels = 42

Definition at line 36 of file blas_test.cu.

◆ Nprec

int Nprec = 3

Definition at line 73 of file blas_test.cu.

Referenced by skip_kernel().

◆ Nspin

int Nspin

◆ Nsrc

int Nsrc

Definition at line 1628 of file test_util.cpp.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ nvec

int nvec

Definition at line 1635 of file test_util.cpp.

Referenced by quda::MPCG::computeMatrixPowers(), and main().

◆ prec

◆ prec_str

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

Definition at line 919 of file blas_test.cu.

Referenced by getblasname().

◆ solve_type

QudaSolveType solve_type

Definition at line 1653 of file test_util.cpp.

Referenced by initFields(), and printQudaInvertParam().

◆ tdim

int tdim

Definition at line 24 of file gauge_force_test.cpp.

Referenced by display_test_info(), and initFields().

◆ test_type

int test_type

Definition at line 1634 of file test_util.cpp.

Referenced by dslashQuda_4dpc(), dslashQuda_mdwf(), main(), and skip_kernel().

◆ vD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ verify_results

bool verify_results

Definition at line 1641 of file test_util.cpp.

Referenced by main().

◆ vH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ wD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ wH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ xD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ xdim

int xdim

Definition at line 1620 of file test_util.cpp.

Referenced by display_test_info(), and initFields().

◆ xH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ xmD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ xmH

std::vector<cpuColorSpinorField*> xmH

Definition at line 42 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ yD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ ydim

int ydim

Definition at line 1621 of file test_util.cpp.

Referenced by display_test_info(), and initFields().

◆ yH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ ymD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ ymH

std::vector<cpuColorSpinorField*> ymH

Definition at line 43 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ zD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ zdim

int zdim

Definition at line 1622 of file test_util.cpp.

Referenced by display_test_info(), and initFields().

◆ zH

Definition at line 40 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().

◆ zmD

Definition at line 41 of file blas_test.cu.

Referenced by benchmark(), freeFields(), initFields(), and test().

◆ zmH

std::vector<cpuColorSpinorField*> zmH

Definition at line 44 of file blas_test.cu.

Referenced by freeFields(), initFields(), and test().