Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ include(cmake/CPM.cmake)

find_package(Git)

if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

# By default we will build DEVEL. The different build types will pass different
# flags to the compiler which may be strict or permissive on warnings, or
# very verbose at run time and/or compile time.
Expand Down Expand Up @@ -337,7 +341,7 @@ set(CMAKE_CXX_FLAGS_STRICT
"-Os"
CACHE STRING "Flags used by the C++ compiler during strict jenkins builds.")
set(CMAKE_CXX_FLAGS_RELEASE
"-O3 ${CXX_OPT}"
"-Zi -O2 ${CXX_OPT}"
CACHE STRING "Flags used by the C++ compiler during release builds.")
set(CMAKE_CXX_FLAGS_HOSTDEBUG
"-g"
Expand All @@ -359,7 +363,7 @@ set(CMAKE_C_FLAGS_STRICT
"-Os"
CACHE STRING "Flags used by the C compiler during strict jenkins builds.")
set(CMAKE_C_FLAGS_RELEASE
"-O3"
"-Zi -O2"
CACHE STRING "Flags used by the C compiler during release builds.")
set(CMAKE_C_FLAGS_HOSTDEBUG
"-g"
Expand Down Expand Up @@ -709,5 +713,7 @@ include(CTest)

# add tests, utils, reference, and quda library
add_subdirectory(lib)
add_subdirectory(tests)
if (NOT WIN32)
add_subdirectory(tests)
endif()
add_subdirectory(doc)
4 changes: 2 additions & 2 deletions include/color_spinor_field_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ namespace quda
using Accessor = FloatNOrder<Float, Ns, Nc, N, spin_project, huge_alloc, disable_ghost>;
using GhostNOrder = GhostNOrder<Float, Ns, Nc, N, spin_project, huge_alloc, disable_ghost>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
using Vector = typename VectorType<Float, N>::type;
using AllocInt = typename AllocType<huge_alloc>::type;
using norm_type = float;
Expand Down Expand Up @@ -1432,7 +1432,7 @@ namespace quda
using Accessor = FloatNOrder<Float, Ns, Nc, N_, spin_project, huge_alloc, disable_ghost>;
using GhostNOrder = GhostNOrder<Float, Ns, Nc, N_, spin_project, huge_alloc, disable_ghost>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
using Vector = int4; // 128-bit packed type
using AllocInt = typename AllocType<huge_alloc>::type;
using norm_type = float;
Expand Down
2 changes: 1 addition & 1 deletion include/communicator_quda.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <unistd.h> // for gethostname()
// #include <unistd.h> // for gethostname()
#include <cassert>
#include <csignal>
#include <limits>
Expand Down
5 changes: 5 additions & 0 deletions include/complex_quda.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

#pragma once

#ifdef _MSC_VER
#define _USE_MATH_DEFINES
#include <math.h>
#undef _USE_MATH_DEFINES
#endif
#include <cmath>
#include <complex>
#include <sstream>
Expand Down
16 changes: 8 additions & 8 deletions include/gauge_field_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ namespace quda {
template <typename Float, int length> struct QDPOrder : public LegacyOrder<Float,length> {
using Accessor = QDPOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge[QUDA_MAX_DIM];
const unsigned int volumeCB;
QDPOrder(const GaugeField &u, Float *gauge_ = 0, Float **ghost_ = 0) :
Expand Down Expand Up @@ -1898,7 +1898,7 @@ namespace quda {
template <typename Float, int length> struct QDPJITOrder : public LegacyOrder<Float,length> {
using Accessor = QDPJITOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge[QUDA_MAX_DIM];
const unsigned int volumeCB;
QDPJITOrder(const GaugeField &u, Float *gauge_ = 0, Float **ghost_ = 0) :
Expand Down Expand Up @@ -1948,7 +1948,7 @@ namespace quda {
template <typename Float, int length> struct MILCOrder : public LegacyOrder<Float,length> {
using Accessor = MILCOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge;
const unsigned int volumeCB;
const int geometry;
Expand Down Expand Up @@ -2009,7 +2009,7 @@ namespace quda {
template <typename Float, int length> struct MILCSiteOrder : public LegacyOrder<Float,length> {
using Accessor = MILCSiteOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge;
const unsigned int volumeCB;
const int geometry;
Expand Down Expand Up @@ -2068,7 +2068,7 @@ namespace quda {
template <typename Float, int length> struct CPSOrder : LegacyOrder<Float,length> {
using Accessor = CPSOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge;
const unsigned int volumeCB;
const real anisotropy;
Expand Down Expand Up @@ -2137,7 +2137,7 @@ namespace quda {
template <typename Float, int length> struct BQCDOrder : LegacyOrder<Float,length> {
using Accessor = BQCDOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge;
const unsigned int volumeCB;
unsigned int exVolumeCB; // extended checkerboard volume
Expand Down Expand Up @@ -2199,7 +2199,7 @@ namespace quda {
template <typename Float, int length> struct TIFROrder : LegacyOrder<Float,length> {
using Accessor = TIFROrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge;
const unsigned int volumeCB;
static constexpr int Nc = 3;
Expand Down Expand Up @@ -2263,7 +2263,7 @@ namespace quda {
template <typename Float, int length> struct TIFRPaddedOrder : LegacyOrder<Float,length> {
using Accessor = TIFRPaddedOrder<Float, length>;
using real = typename mapper<Float>::type;
using complex = complex<real>;
using complex = quda::complex<real>;
Float *gauge;
const unsigned int volumeCB;
int exVolumeCB;
Expand Down
99 changes: 50 additions & 49 deletions include/instantiate.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,32 @@ namespace quda
@brief Helper function for returning if a given gauge field order is enabled
@tparam order The order requested
*/
template <QudaGaugeFieldOrder order> constexpr bool is_enabled();
constexpr bool is_enabled(QudaGaugeFieldOrder order)
{
switch (order) {
#ifdef BUILD_QDP_INTERFACE
template <> constexpr bool is_enabled<QUDA_QDP_GAUGE_ORDER>() { return true; }
#else
template <> constexpr bool is_enabled<QUDA_QDP_GAUGE_ORDER>() { return false; }
case QUDA_QDP_GAUGE_ORDER: return true;
#endif
#ifdef BUILD_QDPJIT_INTERFACE
template <> constexpr bool is_enabled<QUDA_QDPJIT_GAUGE_ORDER>() { return true; }
#else
template <> constexpr bool is_enabled<QUDA_QDPJIT_GAUGE_ORDER>() { return false; }
case QUDA_QDPJIT_GAUGE_ORDER: return true;
#endif
#ifdef BUILD_CPS_INTERFACE
template <> constexpr bool is_enabled<QUDA_CPS_WILSON_GAUGE_ORDER>() { return true; }
#else
template <> constexpr bool is_enabled<QUDA_CPS_WILSON_GAUGE_ORDER>() { return false; }
case QUDA_CPS_WILSON_GAUGE_ORDER: return true;
#endif
#ifdef BUILD_MILC_INTERFACE
template <> constexpr bool is_enabled<QUDA_MILC_GAUGE_ORDER>() { return true; }
template <> constexpr bool is_enabled<QUDA_MILC_SITE_GAUGE_ORDER>() { return true; }
#else
template <> constexpr bool is_enabled<QUDA_MILC_GAUGE_ORDER>() { return false; }
template <> constexpr bool is_enabled<QUDA_MILC_SITE_GAUGE_ORDER>() { return false; }
case QUDA_MILC_GAUGE_ORDER: return true;
case QUDA_MILC_SITE_GAUGE_ORDER: return true;
#endif
#ifdef BUILD_BQCD_INTERFACE
template <> constexpr bool is_enabled<QUDA_BQCD_GAUGE_ORDER>() { return true; }
#else
template <> constexpr bool is_enabled<QUDA_BQCD_GAUGE_ORDER>() { return false; }
case QUDA_BQCD_GAUGE_ORDER: return true;
#endif
#ifdef BUILD_TIFR_INTERFACE
template <> constexpr bool is_enabled<QUDA_TIFR_GAUGE_ORDER>() { return true; }
template <> constexpr bool is_enabled<QUDA_TIFR_PADDED_GAUGE_ORDER>() { return true; }
#else
template <> constexpr bool is_enabled<QUDA_TIFR_GAUGE_ORDER>() { return false; }
template <> constexpr bool is_enabled<QUDA_TIFR_PADDED_GAUGE_ORDER>() { return false; }
case QUDA_TIFR_GAUGE_ORDER: return true;
case QUDA_TIFR_PADDED_GAUGE_ORDER: return true;
#endif
default: return false;
}
}

/**
@brief Helper function for returning if a given precision is enabled
Expand All @@ -89,13 +80,18 @@ namespace quda
@tparam reconstruct The reconstruct requested
@return True if enabled, false if not
*/
template <QudaReconstructType reconstruct> constexpr bool is_enabled();
template <> constexpr bool is_enabled<QUDA_RECONSTRUCT_NO>() { return (QUDA_RECONSTRUCT & 4) ? true : false; }
template <> constexpr bool is_enabled<QUDA_RECONSTRUCT_13>() { return (QUDA_RECONSTRUCT & 2) ? true : false; }
template <> constexpr bool is_enabled<QUDA_RECONSTRUCT_12>() { return (QUDA_RECONSTRUCT & 2) ? true : false; }
template <> constexpr bool is_enabled<QUDA_RECONSTRUCT_9>() { return (QUDA_RECONSTRUCT & 1) ? true : false; }
template <> constexpr bool is_enabled<QUDA_RECONSTRUCT_8>() { return (QUDA_RECONSTRUCT & 1) ? true : false; }
template <> constexpr bool is_enabled<QUDA_RECONSTRUCT_10>() { return true; }
constexpr bool is_enabled(QudaReconstructType reconstruct)
{
switch (reconstruct) {
case QUDA_RECONSTRUCT_NO: return (QUDA_RECONSTRUCT & 4) ? true : false;
case QUDA_RECONSTRUCT_13: return (QUDA_RECONSTRUCT & 2) ? true : false;
case QUDA_RECONSTRUCT_12: return (QUDA_RECONSTRUCT & 2) ? true : false;
case QUDA_RECONSTRUCT_9: return (QUDA_RECONSTRUCT & 1) ? true : false;
case QUDA_RECONSTRUCT_8: return (QUDA_RECONSTRUCT & 1) ? true : false;
case QUDA_RECONSTRUCT_10: return true;
default: return false;
}
}

struct ReconstructFull {
static constexpr std::array<QudaReconstructType, 6> recon
Expand Down Expand Up @@ -142,8 +138,8 @@ namespace quda
void instantiateReconstruct(G &U, Args &&...args)
{
if (U.Reconstruct() == Recon::recon[i]) {
if constexpr (is_enabled<Recon::recon[i]>())
Apply<Float, nColor, Recon::recon[i]>(U, args...);
if constexpr (is_enabled(Recon::recon[i]))
Apply<Float, nColor, Recon::recon[i]> apply(U, args...);
else
errorQuda("QUDA_RECONSTRUCT=%d does not enable %d", QUDA_RECONSTRUCT, Recon::recon[i]);
} else if constexpr (i > 0) {
Expand Down Expand Up @@ -471,13 +467,13 @@ namespace quda
constexpr void instantiateGaugeStaggered(G &U, Args &&...args)
{
if (U.Reconstruct() == QUDA_RECONSTRUCT_NO) {
if constexpr (is_enabled<QUDA_RECONSTRUCT_NO>())
if constexpr (is_enabled(QUDA_RECONSTRUCT_NO))
// actual phase type doesn't matter because the phase is baked into the links
Apply<store_t, nColor, QUDA_RECONSTRUCT_NO, QUDA_STAGGERED_PHASE_NO>(U, args...);
else
errorQuda("QUDA_RECONSTRUCT=%d does not enable %d", QUDA_RECONSTRUCT, QUDA_RECONSTRUCT_NO);
} else if (U.Reconstruct() == QUDA_RECONSTRUCT_13) {
if constexpr (is_enabled<QUDA_RECONSTRUCT_13>()) {
if constexpr (is_enabled(QUDA_RECONSTRUCT_13)) {
if (U.StaggeredPhase() == QUDA_STAGGERED_PHASE_NO)
Apply<store_t, nColor, QUDA_RECONSTRUCT_13, QUDA_STAGGERED_PHASE_NO>(U, args...);
else if (U.StaggeredPhase() == QUDA_STAGGERED_PHASE_MILC)
Expand All @@ -488,7 +484,7 @@ namespace quda
errorQuda("QUDA_RECONSTRUCT=%d does not enable %d", QUDA_RECONSTRUCT, QUDA_RECONSTRUCT_13);
}
} else if (U.Reconstruct() == QUDA_RECONSTRUCT_12) {
if constexpr (is_enabled<QUDA_RECONSTRUCT_12>()) {
if constexpr (is_enabled(QUDA_RECONSTRUCT_12)) {
errorQuda("QUDA_RECONSTRUCT=%d has not been implemented for HISQ gauge routines yet.", QUDA_RECONSTRUCT_12);
} else {
errorQuda("QUDA_RECONSTRUCT=%d does not enable %d\n", QUDA_RECONSTRUCT, QUDA_RECONSTRUCT_12);
Expand Down Expand Up @@ -545,38 +541,43 @@ namespace quda
@tparam dslash_type The dslash_type requested
@return True if enabled, false if not
*/
template <QudaDslashType dslash_type> constexpr bool is_enabled() { return false; }
constexpr bool is_enabled(QudaDslashType dslash_type)
{
switch (dslash_type) {
#ifdef GPU_WILSON_DIRAC
template <> constexpr bool is_enabled<QUDA_WILSON_DSLASH>() { return true; }
case QUDA_WILSON_DSLASH: return true;
#endif
#ifdef GPU_CLOVER_DIRAC
template <> constexpr bool is_enabled<QUDA_CLOVER_WILSON_DSLASH>() { return true; }
case QUDA_CLOVER_WILSON_DSLASH: return true;
#endif
#ifdef GPU_CLOVER_HASENBUSCH_TWIST
template <> constexpr bool is_enabled<QUDA_CLOVER_HASENBUSCH_TWIST_DSLASH>() { return true; }
case QUDA_CLOVER_HASENBUSCH_TWIST_DSLASH: return true;
#endif
#ifdef GPU_DOMAIN_WALL_DIRAC
template <> constexpr bool is_enabled<QUDA_DOMAIN_WALL_DSLASH>() { return true; }
template <> constexpr bool is_enabled<QUDA_DOMAIN_WALL_4D_DSLASH>() { return true; }
template <> constexpr bool is_enabled<QUDA_MOBIUS_DWF_DSLASH>() { return true; }
template <> constexpr bool is_enabled<QUDA_MOBIUS_DWF_EOFA_DSLASH>() { return true; }
case QUDA_DOMAIN_WALL_DSLASH: return true;
case QUDA_DOMAIN_WALL_4D_DSLASH: return true;
case QUDA_MOBIUS_DWF_DSLASH: return true;
case QUDA_MOBIUS_DWF_EOFA_DSLASH: return true;
#endif
#ifdef GPU_STAGGERED_DIRAC
template <> constexpr bool is_enabled<QUDA_STAGGERED_DSLASH>() { return true; }
template <> constexpr bool is_enabled<QUDA_ASQTAD_DSLASH>() { return true; }
case QUDA_STAGGERED_DSLASH: return true;
case QUDA_ASQTAD_DSLASH: return true;
#endif
#ifdef GPU_TWISTED_MASS_DIRAC
template <> constexpr bool is_enabled<QUDA_TWISTED_MASS_DSLASH>() { return true; }
case QUDA_TWISTED_MASS_DSLASH: return true;
#endif
#ifdef GPU_TWISTED_CLOVER_DIRAC
template <> constexpr bool is_enabled<QUDA_TWISTED_CLOVER_DSLASH>() { return true; }
case QUDA_TWISTED_CLOVER_DSLASH: return true;
#endif
#ifdef GPU_LAPLACE
template <> constexpr bool is_enabled<QUDA_LAPLACE_DSLASH>() { return true; }
case QUDA_LAPLACE_DSLASH: return true;
#endif
#ifdef GPU_COVDEV
template <> constexpr bool is_enabled<QUDA_COVDEV_DSLASH>() { return true; }
case QUDA_COVDEV_DSLASH: return true;
#endif
default: return false;
}
}

#ifdef GPU_DISTANCE_PRECONDITIONING
constexpr bool is_enabled_distance_precondition() { return true; }
Expand Down
6 changes: 3 additions & 3 deletions include/instantiate_dslash.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ namespace quda
cvector_ref<const ColorSpinorField> &x, const GaugeField &U, Args &&...args)
{
if (U.Reconstruct() == Recon::recon[0]) {
if constexpr (is_enabled<QUDA_RECONSTRUCT_NO>())
if constexpr (is_enabled(QUDA_RECONSTRUCT_NO))
Apply<Float, nColor, Recon::recon[0]>(out, in, x, U, args...);
else
errorQuda("QUDA_RECONSTRUCT=%d does not enable reconstruct-18", QUDA_RECONSTRUCT);
} else if (U.Reconstruct() == Recon::recon[1]) {
if constexpr (is_enabled<QUDA_RECONSTRUCT_12>())
if constexpr (is_enabled(QUDA_RECONSTRUCT_12))
Apply<Float, nColor, Recon::recon[1]>(out, in, x, U, args...);
else
errorQuda("QUDA_RECONSTRUCT=%d does not enable reconstruct-12/13", QUDA_RECONSTRUCT);
} else if (U.Reconstruct() == Recon::recon[2]) {
if constexpr (is_enabled<QUDA_RECONSTRUCT_8>())
if constexpr (is_enabled(QUDA_RECONSTRUCT_8))
Apply<Float, nColor, Recon::recon[2]>(out, in, x, U, args...);
else
errorQuda("QUDA_RECONSTRUCT=%d does not enable reconstruct-8/9", QUDA_RECONSTRUCT);
Expand Down
3 changes: 3 additions & 0 deletions include/kernel_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include "comm_quda.h"

#undef TRUE
#undef FALSE

namespace quda
{

Expand Down
2 changes: 1 addition & 1 deletion include/kernels/dslash_mdw_fused.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace quda {
bool ret = false;
#pragma unroll
for (int d = 0; d < 4; d++) {
ret = ret or (coordinate[d] >= dim[d] - halo_shift[d] or coordinate[d] < halo_shift[d]);
ret = ret || (coordinate[d] >= dim[d] - halo_shift[d] || coordinate[d] < halo_shift[d]);
}
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions include/kernels/evec_project.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace quda {

using spinor_array = array<double, 8>;

constexpr unsigned long max_nx = 4;
constexpr unsigned long max_ny = 4;
constexpr unsigned long long max_nx = 4;
constexpr unsigned long long max_ny = 4;

template <typename Float, int nColor_>
struct EvecProjectionArg : public ReduceArg<spinor_array>
Expand Down
6 changes: 4 additions & 2 deletions include/kernels/gauge_random.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ namespace quda {
temp2[i] *= radius[i];
}

printf("%f %f\n", phi[0], radius[0]);

// construct Anti-Hermitian matrix
const real rsqrt_3 = quda::rsqrt(3.0);
ret(0, 0) = complex<real>(0.0, temp1[2] + rsqrt_3 * temp2[3]);
Expand Down Expand Up @@ -82,12 +84,12 @@ namespace quda {
getCoords(x, x_cb, arg.X, parity);
for (int dr = 0; dr < 4; ++dr) x[dr] += arg.border[dr]; // extended grid coordinates

if (arg.group and arg.sigma == 0.0) {
if (arg.group && arg.sigma == 0.0) {
// if sigma = 0 then we just set the output matrix to the identity and finish
Link I;
setIdentity(&I);
for (int mu = 0; mu < 4; mu++) arg.U(mu, linkIndex(x, arg.E), parity) = I;
} else if (not arg.group and arg.sigma == 0.0) {
} else if (! arg.group && arg.sigma == 0.0) {
// if sigma = 0 then we just set the output matrix to the zero and finish
Link O = {};
for (int mu = 0; mu < 4; mu++) arg.U(mu, linkIndex(x, arg.E), parity) = O;
Expand Down
Loading