Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sycl
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosborn committed Nov 8, 2024
2 parents 3b1154e + 3414317 commit c573936
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 18 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ if(QUDA_DOWNLOAD_EIGEN)
NAME Eigen
VERSION ${QUDA_EIGEN_VERSION}
URL https://gitlab.com/libeigen/eigen/-/archive/${QUDA_EIGEN_VERSION}/eigen-${QUDA_EIGEN_VERSION}.tar.bz2
URL_HASH SHA256=B4C198460EBA6F28D34894E3A5710998818515104D6E74E5CC331CE31E46E626
DOWNLOAD_ONLY YES
SYSTEM YES)
target_include_directories(Eigen SYSTEM INTERFACE ${Eigen_SOURCE_DIR})
Expand Down
8 changes: 4 additions & 4 deletions include/color_spinor_field_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -1824,8 +1824,8 @@ namespace quda
{
for (int s = 0; s < Ns; s++) {
for (int c = 0; c < Nc; c++) {
v[s * Nc + c] = complex(field[(((0 * Nc + c) * Ns + s) * 2 + (1 - parity)) * volumeCB + x],
field[(((1 * Nc + c) * Ns + s) * 2 + (1 - parity)) * volumeCB + x]);
v[s * Nc + c] = complex(field[(((0 * Nc + c) * Ns + s) * 2 + parity) * volumeCB + x],
field[(((1 * Nc + c) * Ns + s) * 2 + parity) * volumeCB + x]);
}
}
}
Expand All @@ -1834,8 +1834,8 @@ namespace quda
{
for (int s = 0; s < Ns; s++) {
for (int c = 0; c < Nc; c++) {
field[(((0 * Nc + c) * Ns + s) * 2 + (1 - parity)) * volumeCB + x] = v[s * Nc + c].real();
field[(((1 * Nc + c) * Ns + s) * 2 + (1 - parity)) * volumeCB + x] = v[s * Nc + c].imag();
field[(((0 * Nc + c) * Ns + s) * 2 + parity) * volumeCB + x] = v[s * Nc + c].real();
field[(((1 * Nc + c) * Ns + s) * 2 + parity) * volumeCB + x] = v[s * Nc + c].imag();
}
}
}
Expand Down
28 changes: 26 additions & 2 deletions include/kernels/copy_color_spinor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ namespace quda

using namespace colorspinor;

/**
* @brief A helper function to figure out what parity to use for input and output.
* @details Pick parity from input field site order. Addditionally QDPJIT fields
* may need a relative parity flip compared to what is expected when dealing with
* only the odd parity since the pointer is always to the top of the full spinort.
* @param[in] f Reference to the field for parity computation
* @return the computed parity
*/
inline int computeParity(const ColorSpinorField &f)
{

// Account for odd-even vs. even-odd site orders
int ret_val = f.SiteOrder() == QUDA_ODD_EVEN_SITE_ORDER ? 1 : 0;

// Account for potential parity flip to access single parity subset QDP-JIT fields
// The Flip is only needed fir offsetting into Odd Parity Fields
if (f.FieldOrder() == QUDA_QDPJIT_FIELD_ORDER && f.SiteSubset() == QUDA_PARITY_SITE_SUBSET
&& f.SuggestedParity() == QUDA_ODD_PARITY) {
ret_val = 1 - ret_val;
}

return ret_val;
}

template <typename FloatOut, typename FloatIn, int nSpin_, int nColor_, typename Out, typename In,
template <int, int> class Basis_>
struct CopyColorSpinorArg : kernel_param<> {
Expand All @@ -32,8 +56,8 @@ namespace quda
kernel_param(dim3(in.VolumeCB(), in.SiteSubset(), 1)),
out(out, 1, Out_),
in(in, 1, const_cast<FloatIn *>(In_)),
outParity(out.SiteOrder() == QUDA_ODD_EVEN_SITE_ORDER ? 1 : 0),
inParity(in.SiteOrder() == QUDA_ODD_EVEN_SITE_ORDER ? 1 : 0)
outParity(computeParity(out)),
inParity(computeParity(in))
{
}
};
Expand Down
5 changes: 0 additions & 5 deletions lib/copy_color_spinor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ namespace quda
errorQuda("Copying to full fields with lexicographical ordering is not currently supported");
}

if (dst.SiteSubset() == QUDA_FULL_SITE_SUBSET
&& (src.FieldOrder() == QUDA_QDPJIT_FIELD_ORDER || dst.FieldOrder() == QUDA_QDPJIT_FIELD_ORDER)) {
errorQuda("QDPJIT field ordering not supported for full site fields");
}

genericCopyColorSpinor<Ns, Nc>(param);
}

Expand Down
5 changes: 1 addition & 4 deletions lib/interface_quda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4256,7 +4256,6 @@ void computeHISQForceQuda(void* const milc_momentum,

using namespace quda;
using namespace quda::fermion_force;
if (gParam->gauge_order != QUDA_MILC_GAUGE_ORDER) errorQuda("Unsupported input field order %d", gParam->gauge_order);

{
// default settings for the unitarization
Expand Down Expand Up @@ -4399,7 +4398,6 @@ void computeHISQForceQuda(void* const milc_momentum,
GaugeFieldParam param(*gParam);
param.location = QUDA_CPU_FIELD_LOCATION;
param.create = QUDA_REFERENCE_FIELD_CREATE;
param.order = QUDA_MILC_GAUGE_ORDER;
param.link_type = QUDA_ASQTAD_MOM_LINKS;
param.reconstruct = QUDA_RECONSTRUCT_10;
param.ghostExchange = QUDA_GHOST_EXCHANGE_NO;
Expand All @@ -4421,7 +4419,6 @@ void computeHISQForceQuda(void* const milc_momentum,
GaugeFieldParam wParam(gParam_field);
wParam.location = QUDA_CPU_FIELD_LOCATION;
wParam.create = QUDA_REFERENCE_FIELD_CREATE;
wParam.order = QUDA_MILC_GAUGE_ORDER;
wParam.link_type = QUDA_GENERAL_LINKS;
wParam.ghostExchange = QUDA_GHOST_EXCHANGE_NO;
wParam.gauge = (void *)w_link;
Expand Down Expand Up @@ -5590,7 +5587,7 @@ void gaugeObservablesQuda(QudaGaugeObservableParam *param)
auto profile = pushProfile(profileGaugeObs);
checkGaugeObservableParam(param);

if (!gaugePrecise) errorQuda("Cannot compute Polyakov loop as there is no resident gauge field");
if (!gaugePrecise) errorQuda("Cannot compute gauge observables as there is no resident gauge field");

GaugeField *gauge = nullptr;
if (!gaugeSmeared) {
Expand Down
2 changes: 1 addition & 1 deletion lib/multigrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ namespace quda
}

transfer->R(x_coarse[0], tmp2);
static_cast<DiracCoarse *>(diracCoarseResidual)->M(r_coarse, tmp_coarse);
static_cast<DiracCoarse *>(diracCoarseResidual)->M(r_coarse[0], tmp_coarse);

#if 0 // enable to print out emulated and actual coarse-grid operator vectors for debugging
setOutputPrefix("");
Expand Down
4 changes: 2 additions & 2 deletions lib/solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace quda
// rescale the source and solution vectors to help prevent the onset of underflow
if (param.solver_normalization == QUDA_SOURCE_NORMALIZATION) {
auto nb_inv(nb);
for (auto bi : nb_inv) bi = 1 / sqrt(bi);
for (auto &bi : nb_inv) bi = 1 / sqrt(bi);
blas::ax(nb_inv, b);
blas::ax(nb_inv, x);
}
Expand Down Expand Up @@ -299,7 +299,7 @@ namespace quda

if (param.solver_normalization == QUDA_SOURCE_NORMALIZATION) {
// rescale the solution
for (auto bi : nb) bi = sqrt(bi);
for (auto &bi : nb) bi = sqrt(bi);
blas::ax(nb, x);
}

Expand Down

0 comments on commit c573936

Please sign in to comment.