46 void init(
int argc,
char **argv)
58 if (
Nsrc != 1)
warningQuda(
"The covariant derivative doesn't support 5-d indexing, only source 0 will be tested");
93 for (
int dir = 0; dir < 4; dir++) {
95 if (
links[dir] == NULL) {
96 errorQuda(
"ERROR: malloc failed for gauge links");
128 printfQuda(
"Source CPU = %f, CUDA=%f\n", spinor_norm2, cuda_spinor_norm2);
143 for (
int dir = 0; dir < 4; dir++) {
163 cudaEventCreate(&
start);
164 cudaEventRecord(
start, 0);
165 cudaEventSynchronize(
start);
169 cudaEventCreate(&
end);
170 cudaEventRecord(
end, 0);
171 cudaEventSynchronize(
end);
173 cudaEventElapsedTime(&runTime,
start,
end);
174 cudaEventDestroy(
start);
175 cudaEventDestroy(
end);
177 double secs = runTime / 1000;
185 printfQuda(
"Calculating reference implementation...");
199 ASSERT_LE(deviation,
tol) <<
"CPU and CUDA implementations do not agree";
206 printfQuda(
"prec recon test_type dagger S_dim T_dimension\n");
218 int main(
int argc,
char **argv)
227 app->parse(argc, argv);
228 }
catch (
const CLI::ParseError &e) {
243 for (
int i = 0; i < attempts; i++) {
246 for (
int dag = 0; dag < 2; dag++) {
249 for (
int mu = 0;
mu < 4;
mu++) {
251 int muCpu =
mu * 2 + (
dagger ? 1 : 0);
255 printfQuda(
"\n\nChecking muQuda = %d\n", muCuda);
268 unsigned long long flops
276 printfQuda(
"Results mu = %d: CPU=%f, CUDA=%f, CPU-CUDA=%f\n", muCuda, spinor_ref_norm2, cuda_spinor_out_norm2,
QudaGammaBasis gammaBasis
void setPrecision(QudaPrecision precision, QudaPrecision ghost_precision=QUDA_INVALID_PRECISION, bool force_native=false)
QudaFieldOrder fieldOrder
Full Covariant Derivative operator. Although not a Dirac operator per se, it's a linear operator so i...
virtual void MCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
const void ** Ghost() const
void Source(const QudaSourceType sourceType, const int st=0, const int s=0, const int c=0)
static int Compare(const cpuColorSpinorField &a, const cpuColorSpinorField &b, const int resolution=1)
Perform a component by component comparison of two color-spinor fields. In doing we normalize with re...
TestEventListener * Release(TestEventListener *listener)
TestEventListener * default_result_printer() const
TestEventListeners & listeners()
static UnitTest * GetInstance()
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
std::array< int, 4 > gridsize_from_cmdline
void mat(void *out, void **link, void *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision)
void mat_mg4dir(cpuColorSpinorField *out, void **link, void **ghostLink, cpuColorSpinorField *in, int daggerBit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision)
int main(int argc, char **argv)
double dslashCUDA(int niter, int mu)
cudaColorSpinorField * cudaSpinor
cudaColorSpinorField * cudaSpinorOut
cudaColorSpinorField * tmp
void init(int argc, char **argv)
cpuColorSpinorField * spinor
cpuColorSpinorField * spinorOut
cpuColorSpinorField * spinorRef
QudaGaugeParam gauge_param
QudaInvertParam inv_param
@ QUDA_GHOST_EXCHANGE_PAD
@ QUDA_EVEN_ODD_SITE_ORDER
@ QUDA_SPACE_SPIN_COLOR_FIELD_ORDER
enum QudaParity_s QudaParity
#define ASSERT_LE(val1, val2)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
size_t host_gauge_data_type_size
int dimPartitioned(int dim)
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
void constructHostGaugeField(void **gauge, QudaGaugeParam &gauge_param, int argc, char **argv)
void setWilsonGaugeParam(QudaGaugeParam &gauge_param)
void setInvertParam(QudaInvertParam &invertParam, QudaInvertArgs_t &inv_args, int external_precision, int quda_precision, double kappa, double reliable_delta)
const char * get_prec_str(QudaPrecision prec)
const char * get_recon_str(QudaReconstructType recon)
double norm2(const ColorSpinorField &a)
void start()
Start profiling.
__host__ __device__ ValueType pow(ValueType x, ExponentType e)
void setDiracParam(DiracParam &diracParam, QudaInvertParam *inv_param, bool pc)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Main header file for the QUDA library.
QudaGaugeParam newQudaGaugeParam(void)
void initQuda(int device)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
QudaInvertParam newQudaInvertParam(void)
QudaSolutionType solution_type
QudaDslashType dslash_type
QudaGammaBasis gamma_basis
QudaGhostExchange ghostExchange
QudaSiteSubset siteSubset
void setVerbosity(QudaVerbosity verbosity)