QUDA
1.0.0
|
#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>
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) |
#define SMALL_NUM 1e-24 |
Referenced by link_sanity_check_internal_8().
#define stSpinorSiteSize 6 |
Definition at line 12 of file misc.cpp.
Referenced by display_spinor().
void accumulateComplexDotProduct | ( | Float * | a, |
Float * | b, | ||
Float * | c | ||
) |
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().
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().
void complexAddTo | ( | Float * | a, |
Float * | b | ||
) |
void complexConjugateProduct | ( | Float * | a, |
Float * | b, | ||
Float * | c | ||
) |
Definition at line 295 of file misc.cpp.
Referenced by link_sanity_check_internal_8().
void complexDotProduct | ( | Float * | a, |
Float * | b, | ||
Float * | c | ||
) |
Definition at line 302 of file misc.cpp.
Referenced by link_sanity_check_internal_8().
void complexProduct | ( | Float * | a, |
Float * | b, | ||
Float * | c | ||
) |
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.
void display_link_internal | ( | Float * | link | ) |
Definition at line 47 of file misc.cpp.
Referenced by display_link(), link_sanity_check(), link_sanity_check_internal_12(), link_sanity_check_internal_8(), site_link_sanity_check(), and site_link_sanity_check_internal_12().
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.
void display_spinor_internal | ( | Float * | spinor | ) |
Definition at line 14 of file misc.cpp.
Referenced by display_spinor().
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().
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().
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().
const char* get_dslash_str | ( | QudaDslashType | type | ) |
Definition at line 910 of file misc.cpp.
References QUDA_ASQTAD_DSLASH, QUDA_CLOVER_WILSON_DSLASH, QUDA_DOMAIN_WALL_4D_DSLASH, QUDA_DOMAIN_WALL_DSLASH, QUDA_LAPLACE_DSLASH, QUDA_MOBIUS_DWF_DSLASH, QUDA_STAGGERED_DSLASH, QUDA_TWISTED_CLOVER_DSLASH, QUDA_TWISTED_MASS_DSLASH, and QUDA_WILSON_DSLASH.
Referenced by display_test_info().
QudaDslashType get_dslash_type | ( | char * | s | ) |
Definition at line 877 of file misc.cpp.
References QUDA_ASQTAD_DSLASH, QUDA_CLOVER_WILSON_DSLASH, QUDA_DOMAIN_WALL_4D_DSLASH, QUDA_DOMAIN_WALL_DSLASH, QUDA_INVALID_DSLASH, QUDA_LAPLACE_DSLASH, QUDA_MOBIUS_DWF_DSLASH, QUDA_STAGGERED_DSLASH, QUDA_TWISTED_CLOVER_DSLASH, QUDA_TWISTED_MASS_DSLASH, and QUDA_WILSON_DSLASH.
Referenced by process_command_line_option().
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().
QudaEigSpectrumType get_eig_spectrum_type | ( | char * | s | ) |
Definition at line 983 of file misc.cpp.
References QUDA_SPECTRUM_INVALID, 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 process_command_line_option().
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().
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().
const char* get_flavor_str | ( | QudaTwistFlavorType | type | ) |
Definition at line 1264 of file misc.cpp.
References QUDA_TWIST_DEG_DOUBLET, QUDA_TWIST_NO, QUDA_TWIST_NONDEG_DOUBLET, and QUDA_TWIST_SINGLET.
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().
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().
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().
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().
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().
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().
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().
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().
QudaPrecision get_prec | ( | char * | s | ) |
Definition at line 678 of file misc.cpp.
References QUDA_DOUBLE_PRECISION, QUDA_HALF_PRECISION, QUDA_QUARTER_PRECISION, and QUDA_SINGLE_PRECISION.
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().
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().
int get_rank_order | ( | char * | s | ) |
Definition at line 860 of file misc.cpp.
Referenced by process_command_line_option().
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().
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().
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().
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().
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().
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().
const char* get_solve_str | ( | QudaSolveType | type | ) |
Definition at line 1171 of file misc.cpp.
References QUDA_DIRECT_PC_SOLVE, QUDA_DIRECT_SOLVE, QUDA_NORMERR_PC_SOLVE, QUDA_NORMERR_SOLVE, QUDA_NORMOP_PC_SOLVE, and QUDA_NORMOP_SOLVE.
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().
const char* get_solver_str | ( | QudaInverterType | type | ) |
Definition at line 1353 of file misc.cpp.
References errorQuda, QUDA_BICGSTAB_INVERTER, QUDA_BICGSTABL_INVERTER, QUDA_CA_CG_INVERTER, QUDA_CA_CGNE_INVERTER, QUDA_CA_CGNR_INVERTER, QUDA_CA_GCR_INVERTER, QUDA_CG3_INVERTER, QUDA_CG3NE_INVERTER, QUDA_CG3NR_INVERTER, QUDA_CG_INVERTER, QUDA_CGNE_INVERTER, QUDA_CGNR_INVERTER, QUDA_EIGCG_INVERTER, QUDA_FGMRESDR_INVERTER, QUDA_GCR_INVERTER, QUDA_GMRESDR_INVERTER, QUDA_GMRESDR_PROJ_INVERTER, QUDA_GMRESDR_SH_INVERTER, QUDA_INC_EIGCG_INVERTER, QUDA_MG_INVERTER, QUDA_MPBICGSTAB_INVERTER, QUDA_MPCG_INVERTER, QUDA_MR_INVERTER, QUDA_PCG_INVERTER, and QUDA_SD_INVERTER.
QudaInverterType get_solver_type | ( | char * | s | ) |
Definition at line 1290 of file misc.cpp.
References QUDA_BICGSTAB_INVERTER, QUDA_BICGSTABL_INVERTER, QUDA_CA_CG_INVERTER, QUDA_CA_CGNE_INVERTER, QUDA_CA_CGNR_INVERTER, QUDA_CA_GCR_INVERTER, QUDA_CG3_INVERTER, QUDA_CG3NE_INVERTER, QUDA_CG3NR_INVERTER, QUDA_CG_INVERTER, QUDA_CGNE_INVERTER, QUDA_CGNR_INVERTER, QUDA_EIGCG_INVERTER, QUDA_FGMRESDR_INVERTER, QUDA_GCR_INVERTER, QUDA_GMRESDR_INVERTER, QUDA_GMRESDR_PROJ_INVERTER, QUDA_GMRESDR_SH_INVERTER, QUDA_INC_EIGCG_INVERTER, QUDA_INVALID_INVERTER, QUDA_MG_INVERTER, QUDA_MPBICGSTAB_INVERTER, QUDA_MPCG_INVERTER, QUDA_MR_INVERTER, QUDA_PCG_INVERTER, and QUDA_SD_INVERTER.
Referenced by process_command_line_option().
const char* get_staggered_test_type | ( | int | t | ) |
Definition at line 827 of file misc.cpp.
Referenced by display_test_info().
const char* get_test_type | ( | int | t | ) |
Definition at line 796 of file misc.cpp.
Referenced by display_test_info().
const char* get_unitarization_str | ( | bool | svd_only | ) |
Definition at line 728 of file misc.cpp.
Referenced by display_test_info().
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.
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().
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.
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().
int link_sanity_check_internal_8 | ( | Float * | link, |
int | dir, | ||
int | ga_idx, | ||
QudaGaugeParam * | gaugeParam, | ||
int | oddBit | ||
) |
Definition at line 323 of file misc.cpp.
References accumulateComplexProduct(), quda::atan2(), complexConjugateProduct(), complexDotProduct(), quda::cos(), display_link_internal(), fullLatticeIndex(), index(), memset(), QUDA_ANTI_PERIODIC_T, ref, quda::sin(), SMALL_NUM, quda::sqrt(), QudaGaugeParam_s::t_boundary, QudaGaugeParam_s::tadpole_coeff, QudaGaugeParam_s::X, X1, X2, X3, and X4.
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.
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().