QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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/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_SUITE_P (QUDA, BlasTest, Combine(Range(0, 4), Range(0, Nkernels)), getblasname)
 

Variables

int test_type
 
QudaPrecision prec
 
QudaDslashType dslash_type
 
QudaInverterType inv_type
 
int nvec [QUDA_MAX_MG_LEVEL]
 
int device
 
int xdim
 
int ydim
 
int zdim
 
int tdim
 
int gridsize_from_cmdline []
 
int niter
 
int Nsrc
 
int Msrc
 
QudaSolveType solve_type
 
QudaVerbosity verbosity
 
const int Nkernels = 40
 
ColorSpinorFieldxH
 
ColorSpinorFieldyH
 
ColorSpinorFieldzH
 
ColorSpinorFieldwH
 
ColorSpinorFieldvH
 
ColorSpinorFieldhH
 
ColorSpinorFieldmH
 
ColorSpinorFieldlH
 
ColorSpinorFieldxD
 
ColorSpinorFieldyD
 
ColorSpinorFieldzD
 
ColorSpinorFieldwD
 
ColorSpinorFieldvD
 
ColorSpinorFieldhD
 
ColorSpinorFieldmD
 
ColorSpinorFieldlD
 
ColorSpinorFieldxmD
 
ColorSpinorFieldymD
 
ColorSpinorFieldzmD
 
std::vector< cpuColorSpinorField * > xmH
 
std::vector< cpuColorSpinorField * > ymH
 
std::vector< cpuColorSpinorField * > zmH
 
int Nspin
 
int Ncolor
 
int Nprec = 4
 
const char * prec_str [] = {"quarter", "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 502 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 58 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 269 of file blas_test.cu.

References hD, hH, lD, lH, mD, mH, Msrc, Nsrc, vD, vH, wD, wH, xD, xH, xmD, yD, yH, ymD, zD, zH, and zmD.

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 1065 of file blas_test.cu.

References INSTANTIATE_TEST_SUITE_P(), names, Nkernels, param, prec, and prec_str.

Here is the call graph for this function:

◆ initFields()

void initFields ( int  prec)

◆ INSTANTIATE_TEST_SUITE_P()

INSTANTIATE_TEST_SUITE_P ( QUDA  ,
BlasTest  ,
Combine(Range(0, 4), Range(0, Nkernels))  ,
getblasname   
)

Referenced by getblasname().

Here is the caller graph for this function:

◆ 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 quda::ColorSpinorParam::fieldOrder, Nspin, QUDA_DOUBLE_PRECISION, QUDA_FLOAT2_FIELD_ORDER, QUDA_FLOAT4_FIELD_ORDER, and quda::ColorSpinorParam::setPrecision().

Referenced by initFields().

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

◆ skip_kernel()

bool skip_kernel ( int  precision,
int  kernel 
)

Definition at line 74 of file blas_test.cu.

References getPrecision(), Ncolor, Nprec, Nspin, prec, QUDA_INVALID_PRECISION, and test_type.

Referenced by TEST_P().

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

◆ test()

double test ( int  kernel)

◆ TEST_P() [1/2]

TEST_P ( BlasTest  ,
verify   
)

Definition at line 1030 of file blas_test.cu.

References 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 1044 of file blas_test.cu.

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

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

◆ device

int device

◆ dslash_type

QudaDslashType dslash_type

Definition at line 1621 of file test_util.cpp.

Referenced by main(), printQudaInvertParam(), and staggered_dslash().

◆ 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().

◆ hD

Definition at line 41 of file blas_test.cu.

Referenced by freeFields().

◆ hH

Definition at line 40 of file blas_test.cu.

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

◆ inv_type

QudaInverterType inv_type

Definition at line 1640 of file test_util.cpp.

Referenced by main(), and printQudaInvertParam().

◆ lD

Definition at line 41 of file blas_test.cu.

Referenced by freeFields().

◆ lH

Definition at line 40 of file blas_test.cu.

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

◆ mD

Definition at line 41 of file blas_test.cu.

Referenced by freeFields().

◆ mH

Definition at line 40 of file blas_test.cu.

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

◆ Msrc

int Msrc

Definition at line 1628 of file test_util.cpp.

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

◆ names

const char* names[]

Definition at line 914 of file blas_test.cu.

Referenced by getblasname(), and TEST_P().

◆ Ncolor

int Ncolor

◆ niter

int niter

Definition at line 1629 of file test_util.cpp.

Referenced by benchmark(), and TEST_P().

◆ Nkernels

const int Nkernels = 40

Definition at line 36 of file blas_test.cu.

Referenced by getblasname().

◆ Nprec

int Nprec = 4

Definition at line 72 of file blas_test.cu.

Referenced by skip_kernel().

◆ Nspin

int Nspin

◆ Nsrc

int Nsrc

Definition at line 1627 of file test_util.cpp.

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

◆ nvec

int nvec[QUDA_MAX_MG_LEVEL]

Definition at line 1637 of file test_util.cpp.

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

◆ prec

◆ prec_str

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

◆ solve_type

QudaSolveType solve_type

Definition at line 1663 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 1636 of file test_util.cpp.

Referenced by main(), and skip_kernel().

◆ vD

Definition at line 41 of file blas_test.cu.

Referenced by freeFields().

◆ verbosity

QudaVerbosity verbosity

◆ 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 freeFields().

◆ 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 quda::MG::buildFreeVectors(), freeFields(), and test().

◆ xdim

int xdim

Definition at line 1615 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 freeFields().

◆ xmH

std::vector<cpuColorSpinorField*> xmH

Definition at line 42 of file blas_test.cu.

◆ yD

Definition at line 41 of file blas_test.cu.

Referenced by freeFields(), and test().

◆ ydim

int ydim

Definition at line 1616 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 freeFields().

◆ ymH

std::vector<cpuColorSpinorField*> ymH

Definition at line 43 of file blas_test.cu.

◆ zD

Definition at line 41 of file blas_test.cu.

Referenced by freeFields().

◆ zdim

int zdim

Definition at line 1617 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 freeFields().

◆ zmH

std::vector<cpuColorSpinorField*> zmH

Definition at line 44 of file blas_test.cu.