QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Functions
misc.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include "quda.h"
#include <string.h>
#include "invert_quda.h"
#include "misc.h"
#include <assert.h>
#include "util_quda.h"
#include <test_util.h>
Include dependency graph for misc.cpp:

Go to the source code of this file.

Macros

#define stSpinorSiteSize   6
 
#define SMALL_NUM   1e-24
 

Functions

template<typename Float >
void display_spinor_internal (Float *spinor)
 
void display_spinor (void *spinor, int len, int precision)
 
template<typename Float >
void display_link_internal (Float *link)
 
void display_link (void *link, int len, int precision)
 
template<typename Float >
void accumulateConjugateProduct (Float *a, Float *b, Float *c, int sign)
 
template<typename Float >
int link_sanity_check_internal_12 (Float *link, int dir, int ga_idx, QudaGaugeParam *gaugeParam, int oddBit)
 
template<typename Float >
int site_link_sanity_check_internal_12 (Float *link, int dir, int ga_idx, QudaGaugeParam *gaugeParam, int oddBit)
 
template<typename Float >
void complexAddTo (Float *a, Float *b)
 
template<typename Float >
void complexProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void complexConjugateProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void complexDotProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void accumulateComplexProduct (Float *a, Float *b, Float *c, Float sign)
 
template<typename Float >
void accumulateComplexDotProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
int link_sanity_check_internal_8 (Float *link, int dir, int ga_idx, QudaGaugeParam *gaugeParam, int oddBit)
 
int link_sanity_check (void *link, int len, int precision, int dir, QudaGaugeParam *gaugeParam)
 
int site_link_sanity_check (void *link, int len, int precision, QudaGaugeParam *gaugeParam)
 
QudaVerbosity get_verbosity_type (char *s)
 
const char * get_verbosity_str (QudaVerbosity type)
 
QudaReconstructType get_recon (char *s)
 
QudaPrecision get_prec (char *s)
 
const char * get_prec_str (QudaPrecision prec)
 
const char * get_unitarization_str (bool svd_only)
 
const char * get_gauge_order_str (QudaGaugeFieldOrder order)
 
const char * get_recon_str (QudaReconstructType recon)
 
const char * get_test_type (int t)
 
const char * get_staggered_test_type (int t)
 
int get_rank_order (char *s)
 
QudaDslashType get_dslash_type (char *s)
 
const char * get_dslash_str (QudaDslashType type)
 
QudaContractType get_contract_type (char *s)
 
const char * get_contract_str (QudaContractType type)
 
QudaEigSpectrumType get_eig_spectrum_type (char *s)
 
const char * get_eig_spectrum_str (QudaEigSpectrumType type)
 
QudaEigType get_eig_type (char *s)
 
const char * get_eig_type_str (QudaEigType type)
 
QudaMassNormalization get_mass_normalization_type (char *s)
 
const char * get_mass_normalization_str (QudaMassNormalization type)
 
QudaMatPCType get_matpc_type (char *s)
 
const char * get_matpc_str (QudaMatPCType type)
 
QudaSolveType get_solve_type (char *s)
 
const char * get_solve_str (QudaSolveType type)
 
QudaSolutionType get_solution_type (char *s)
 
QudaSchwarzType get_schwarz_type (char *s)
 
QudaTwistFlavorType get_flavor_type (char *s)
 
const char * get_flavor_str (QudaTwistFlavorType type)
 
QudaInverterType get_solver_type (char *s)
 
const char * get_solver_str (QudaInverterType type)
 
const char * get_quda_ver_str ()
 
QudaExtLibType get_solve_ext_lib_type (char *s)
 
QudaFieldLocation get_location (char *s)
 
const char * get_ritz_location_str (QudaFieldLocation type)
 
QudaMemoryType get_df_mem_type_ritz (char *s)
 
const char * get_memory_type_str (QudaMemoryType type)
 

Macro Definition Documentation

◆ SMALL_NUM

#define SMALL_NUM   1e-24

◆ stSpinorSiteSize

#define stSpinorSiteSize   6

Definition at line 12 of file misc.cpp.

Referenced by display_spinor().

Function Documentation

◆ accumulateComplexDotProduct()

template<typename Float >
void accumulateComplexDotProduct ( Float *  a,
Float *  b,
Float *  c 
)

Definition at line 316 of file misc.cpp.

◆ accumulateComplexProduct()

template<typename Float >
void accumulateComplexProduct ( Float *  a,
Float *  b,
Float *  c,
Float  sign 
)

Definition at line 309 of file misc.cpp.

Referenced by link_sanity_check_internal_8().

Here is the caller graph for this function:

◆ accumulateConjugateProduct()

template<typename Float >
void accumulateConjugateProduct ( Float *  a,
Float *  b,
Float *  c,
int  sign 
)

Definition at line 84 of file misc.cpp.

Referenced by link_sanity_check_internal_12(), and site_link_sanity_check_internal_12().

Here is the caller graph for this function:

◆ complexAddTo()

template<typename Float >
void complexAddTo ( Float *  a,
Float *  b 
)

Definition at line 281 of file misc.cpp.

◆ complexConjugateProduct()

template<typename Float >
void complexConjugateProduct ( Float *  a,
Float *  b,
Float *  c 
)

Definition at line 295 of file misc.cpp.

Referenced by link_sanity_check_internal_8().

Here is the caller graph for this function:

◆ complexDotProduct()

template<typename Float >
void complexDotProduct ( Float *  a,
Float *  b,
Float *  c 
)

Definition at line 302 of file misc.cpp.

Referenced by link_sanity_check_internal_8().

Here is the caller graph for this function:

◆ complexProduct()

template<typename Float >
void complexProduct ( Float *  a,
Float *  b,
Float *  c 
)

Definition at line 288 of file misc.cpp.

◆ display_link()

void display_link ( void *  link,
int  len,
int  precision 
)

Definition at line 63 of file misc.cpp.

References display_link_internal(), gaugeSiteSize, QUDA_DOUBLE_PRECISION, and QUDA_SINGLE_PRECISION.

Here is the call graph for this function:

◆ display_link_internal()

template<typename Float >
void display_link_internal ( Float *  link)

◆ display_spinor()

void display_spinor ( void *  spinor,
int  len,
int  precision 
)

Definition at line 26 of file misc.cpp.

References display_spinor_internal(), QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION, and stSpinorSiteSize.

Here is the call graph for this function:

◆ display_spinor_internal()

template<typename Float >
void display_spinor_internal ( Float *  spinor)

Definition at line 14 of file misc.cpp.

Referenced by display_spinor().

Here is the caller graph for this function:

◆ get_contract_str()

const char* get_contract_str ( QudaContractType  type)

Definition at line 970 of file misc.cpp.

References QUDA_CONTRACT_TYPE_DR, and QUDA_CONTRACT_TYPE_OPEN.

Referenced by test().

Here is the caller graph for this function:

◆ get_contract_type()

QudaContractType get_contract_type ( char *  s)

Definition at line 955 of file misc.cpp.

References QUDA_CONTRACT_TYPE_DR, QUDA_CONTRACT_TYPE_INVALID, and QUDA_CONTRACT_TYPE_OPEN.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_df_mem_type_ritz()

QudaMemoryType get_df_mem_type_ritz ( char *  s)

Definition at line 1505 of file misc.cpp.

References QUDA_MEMORY_DEVICE, QUDA_MEMORY_INVALID, QUDA_MEMORY_MAPPED, and QUDA_MEMORY_PINNED.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_dslash_str()

const char* get_dslash_str ( QudaDslashType  type)

◆ get_dslash_type()

QudaDslashType get_dslash_type ( char *  s)

◆ get_eig_spectrum_str()

const char* get_eig_spectrum_str ( QudaEigSpectrumType  type)

Definition at line 1008 of file misc.cpp.

References QUDA_SPECTRUM_LI_EIG, QUDA_SPECTRUM_LM_EIG, QUDA_SPECTRUM_LR_EIG, QUDA_SPECTRUM_SI_EIG, QUDA_SPECTRUM_SM_EIG, and QUDA_SPECTRUM_SR_EIG.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_eig_spectrum_type()

QudaEigSpectrumType get_eig_spectrum_type ( char *  s)

◆ get_eig_type()

QudaEigType get_eig_type ( char *  s)

Definition at line 1025 of file misc.cpp.

References QUDA_EIG_INVALID, QUDA_EIG_IR_ARNOLDI, QUDA_EIG_IR_LANCZOS, and QUDA_EIG_TR_LANCZOS.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_eig_type_str()

const char* get_eig_type_str ( QudaEigType  type)

Definition at line 1044 of file misc.cpp.

References QUDA_EIG_IR_ARNOLDI, QUDA_EIG_IR_LANCZOS, and QUDA_EIG_TR_LANCZOS.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_flavor_str()

const char* get_flavor_str ( QudaTwistFlavorType  type)

◆ get_flavor_type()

QudaTwistFlavorType get_flavor_type ( char *  s)

Definition at line 1243 of file misc.cpp.

References QUDA_TWIST_DEG_DOUBLET, QUDA_TWIST_NO, QUDA_TWIST_NONDEG_DOUBLET, and QUDA_TWIST_SINGLET.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_gauge_order_str()

const char* get_gauge_order_str ( QudaGaugeFieldOrder  order)

Definition at line 741 of file misc.cpp.

References QUDA_CPS_WILSON_GAUGE_ORDER, QUDA_MILC_GAUGE_ORDER, and QUDA_QDP_GAUGE_ORDER.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_location()

QudaFieldLocation get_location ( char *  s)

Definition at line 1475 of file misc.cpp.

References QUDA_CPU_FIELD_LOCATION, QUDA_CUDA_FIELD_LOCATION, and QUDA_INVALID_FIELD_LOCATION.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_mass_normalization_str()

const char* get_mass_normalization_str ( QudaMassNormalization  type)

Definition at line 1077 of file misc.cpp.

References QUDA_ASYMMETRIC_MASS_NORMALIZATION, QUDA_KAPPA_NORMALIZATION, QUDA_MASS_NORMALIZATION, and quda::s.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_mass_normalization_type()

QudaMassNormalization get_mass_normalization_type ( char *  s)

Definition at line 1058 of file misc.cpp.

References QUDA_ASYMMETRIC_MASS_NORMALIZATION, QUDA_INVALID_NORMALIZATION, QUDA_KAPPA_NORMALIZATION, and QUDA_MASS_NORMALIZATION.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_matpc_str()

const char* get_matpc_str ( QudaMatPCType  type)

Definition at line 1121 of file misc.cpp.

References QUDA_MATPC_EVEN_EVEN, QUDA_MATPC_EVEN_EVEN_ASYMMETRIC, QUDA_MATPC_ODD_ODD, and QUDA_MATPC_ODD_ODD_ASYMMETRIC.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_matpc_type()

QudaMatPCType get_matpc_type ( char *  s)

Definition at line 1100 of file misc.cpp.

References QUDA_MATPC_EVEN_EVEN, QUDA_MATPC_EVEN_EVEN_ASYMMETRIC, QUDA_MATPC_INVALID, QUDA_MATPC_ODD_ODD, and QUDA_MATPC_ODD_ODD_ASYMMETRIC.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_memory_type_str()

const char* get_memory_type_str ( QudaMemoryType  type)

Definition at line 1523 of file misc.cpp.

References QUDA_MEMORY_DEVICE, QUDA_MEMORY_MAPPED, QUDA_MEMORY_PINNED, and quda::s.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_prec()

QudaPrecision get_prec ( char *  s)

◆ get_prec_str()

const char* get_prec_str ( QudaPrecision  prec)

Definition at line 701 of file misc.cpp.

References QUDA_DOUBLE_PRECISION, QUDA_HALF_PRECISION, QUDA_QUARTER_PRECISION, and QUDA_SINGLE_PRECISION.

Referenced by display_test_info(), and main().

Here is the caller graph for this function:

◆ get_quda_ver_str()

const char* get_quda_ver_str ( )

Definition at line 1443 of file misc.cpp.

References QUDA_VERSION_MAJOR, QUDA_VERSION_MINOR, and QUDA_VERSION_SUBMINOR.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_rank_order()

int get_rank_order ( char *  s)

Definition at line 860 of file misc.cpp.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_recon()

QudaReconstructType get_recon ( char *  s)

Definition at line 653 of file misc.cpp.

References QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_13, QUDA_RECONSTRUCT_8, QUDA_RECONSTRUCT_9, and QUDA_RECONSTRUCT_NO.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_recon_str()

const char* get_recon_str ( QudaReconstructType  recon)

Definition at line 768 of file misc.cpp.

References QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_13, QUDA_RECONSTRUCT_8, QUDA_RECONSTRUCT_9, and QUDA_RECONSTRUCT_NO.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_ritz_location_str()

const char* get_ritz_location_str ( QudaFieldLocation  type)

Definition at line 1491 of file misc.cpp.

References QUDA_CPU_FIELD_LOCATION, QUDA_CUDA_FIELD_LOCATION, and quda::s.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_schwarz_type()

QudaSchwarzType get_schwarz_type ( char *  s)

Definition at line 1224 of file misc.cpp.

References QUDA_ADDITIVE_SCHWARZ, QUDA_INVALID_SCHWARZ, and QUDA_MULTIPLICATIVE_SCHWARZ.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_solution_type()

QudaSolutionType get_solution_type ( char *  s)

Definition at line 1202 of file misc.cpp.

References QUDA_INVALID_SOLUTION, QUDA_MAT_SOLUTION, QUDA_MATDAG_MAT_SOLUTION, QUDA_MATPC_DAG_SOLUTION, QUDA_MATPC_SOLUTION, and QUDA_MATPCDAG_MATPC_SOLUTION.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_solve_ext_lib_type()

QudaExtLibType get_solve_ext_lib_type ( char *  s)

Definition at line 1458 of file misc.cpp.

References QUDA_EIGEN_EXTLIB, QUDA_EXTLIB_INVALID, and QUDA_MAGMA_EXTLIB.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_solve_str()

const char* get_solve_str ( QudaSolveType  type)

◆ get_solve_type()

QudaSolveType get_solve_type ( char *  s)

Definition at line 1146 of file misc.cpp.

References QUDA_DIRECT_PC_SOLVE, QUDA_DIRECT_SOLVE, QUDA_INVALID_SOLVE, QUDA_NORMERR_PC_SOLVE, QUDA_NORMERR_SOLVE, QUDA_NORMOP_PC_SOLVE, and QUDA_NORMOP_SOLVE.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ get_solver_str()

const char* get_solver_str ( QudaInverterType  type)

◆ get_solver_type()

QudaInverterType get_solver_type ( char *  s)

◆ get_staggered_test_type()

const char* get_staggered_test_type ( int  t)

Definition at line 827 of file misc.cpp.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_test_type()

const char* get_test_type ( int  t)

Definition at line 796 of file misc.cpp.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_unitarization_str()

const char* get_unitarization_str ( bool  svd_only)

Definition at line 728 of file misc.cpp.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ get_verbosity_str()

const char* get_verbosity_str ( QudaVerbosity  type)

Definition at line 627 of file misc.cpp.

References QUDA_DEBUG_VERBOSE, QUDA_SILENT, QUDA_SUMMARIZE, and QUDA_VERBOSE.

◆ get_verbosity_type()

QudaVerbosity get_verbosity_type ( char *  s)

Definition at line 606 of file misc.cpp.

References QUDA_DEBUG_VERBOSE, QUDA_INVALID_VERBOSITY, QUDA_SILENT, QUDA_SUMMARIZE, and QUDA_VERBOSE.

Referenced by process_command_line_option().

Here is the caller graph for this function:

◆ link_sanity_check()

int link_sanity_check ( void *  link,
int  len,
int  precision,
int  dir,
QudaGaugeParam gaugeParam 
)

Definition at line 469 of file misc.cpp.

References display_link_internal(), gaugeSiteSize, link_sanity_check_internal_12(), QUDA_DOUBLE_PRECISION, and QUDA_SINGLE_PRECISION.

Here is the call graph for this function:

◆ link_sanity_check_internal_12()

template<typename Float >
int link_sanity_check_internal_12 ( Float *  link,
int  dir,
int  ga_idx,
QudaGaugeParam gaugeParam,
int  oddBit 
)

Definition at line 91 of file misc.cpp.

References accumulateConjugateProduct(), display_link_internal(), fullLatticeIndex(), index(), memset(), QUDA_ANTI_PERIODIC_T, QudaGaugeParam_s::t_boundary, QudaGaugeParam_s::tadpole_coeff, QudaGaugeParam_s::X, X1, X2, X3, and X4.

Referenced by link_sanity_check().

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

◆ link_sanity_check_internal_8()

template<typename Float >
int link_sanity_check_internal_8 ( Float *  link,
int  dir,
int  ga_idx,
QudaGaugeParam gaugeParam,
int  oddBit 
)

◆ site_link_sanity_check()

int site_link_sanity_check ( void *  link,
int  len,
int  precision,
QudaGaugeParam gaugeParam 
)

Definition at line 542 of file misc.cpp.

References display_link_internal(), gaugeSiteSize, QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION, site_link_sanity_check_internal_12(), TUP, and XUP.

Here is the call graph for this function:

◆ site_link_sanity_check_internal_12()

template<typename Float >
int site_link_sanity_check_internal_12 ( Float *  link,
int  dir,
int  ga_idx,
QudaGaugeParam gaugeParam,
int  oddBit 
)

Definition at line 190 of file misc.cpp.

References accumulateConjugateProduct(), display_link_internal(), fullLatticeIndex(), index(), last_node_in_t(), memset(), TUP, QudaGaugeParam_s::X, X1, X2, X3, X4, XUP, YUP, and ZUP.

Referenced by site_link_sanity_check().

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