Skip to content

Commit

Permalink
changed argument types in the interface functions (now are passed by …
Browse files Browse the repository at this point in the history
…pointers)
  • Loading branch information
alexstrel committed Dec 4, 2023
1 parent 4d76007 commit 92e6bf8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions include/quda.h
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ extern "C" {
* @param dir Direction of application
* @param param Metadata for host and device storage
*/
void covDevQuda(void *h_out, void *h_in, int dir, QudaInvertParam param);
void covDevQuda(void *h_out, void *h_in, int dir, QudaInvertParam *param);

/**
* Apply the covariant derivative.
Expand All @@ -1304,7 +1304,7 @@ extern "C" {
* @param sym Apply forward=2, backward=2 or symmetric=3 shift
* @param param Metadata for host and device storage
*/
void shiftQuda(void *h_out, void *h_in, int dir, int sym, QudaInvertParam param);
void shiftQuda(void *h_out, void *h_in, int dir, int sym, QudaInvertParam *param);

/**
* Apply the spin-taste operator.
Expand All @@ -1314,7 +1314,7 @@ extern "C" {
* @param taste Taste gamma structure
* @param param Metadata for host and device storage
*/
void spinTasteQuda(void *h_out, void *h_in, int spin_, int taste, QudaInvertParam inv_param);
void spinTasteQuda(void *h_out, void *h_in, int spin_, int taste, QudaInvertParam *param);

/**
* @brief Perform the solve like @dslashQuda but for multiple rhs by spliting the comm grid into
Expand Down
12 changes: 9 additions & 3 deletions lib/interface_quda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,13 +1872,15 @@ void dslashQuda(void *h_out, void *h_in, QudaInvertParam *inv_param, QudaParity
popVerbosity();
}

void shiftQuda(void *h_out, void *h_in, int dir, int sym, QudaInvertParam inv_param)
void shiftQuda(void *h_out, void *h_in, int dir, int sym, QudaInvertParam *param)
{
profileCovDev.TPSTART(QUDA_PROFILE_TOTAL);
profileCovDev.TPSTART(QUDA_PROFILE_INIT);

const auto &gauge = *gaugePrecise; //(inv_param->dslash_type != QUDA_ASQTAD_DSLASH) ? *gaugePrecise : *gaugeFatPrecise;

QudaInvertParam &inv_param = *param;

inv_param.solution_type = QUDA_MAT_SOLUTION;
inv_param.dirac_order = QUDA_DIRAC_ORDER;

Expand Down Expand Up @@ -1958,13 +1960,15 @@ void shiftQuda(void *h_out, void *h_in, int dir, int sym, QudaInvertParam inv_pa
profileCovDev.TPSTOP(QUDA_PROFILE_TOTAL);
}

void spinTasteQuda(void *h_out, void *h_in, int spin_, int taste, QudaInvertParam inv_param)
void spinTasteQuda(void *h_out, void *h_in, int spin_, int taste, QudaInvertParam *param)
{
profileCovDev.TPSTART(QUDA_PROFILE_TOTAL);
profileCovDev.TPSTART(QUDA_PROFILE_INIT);

const auto &gauge = *gaugePrecise; //(inv_param->dslash_type != QUDA_ASQTAD_DSLASH) ? *gaugePrecise : *gaugeFatPrecise;

QudaInvertParam &inv_param = *param;

inv_param.solution_type = QUDA_MAT_SOLUTION;
inv_param.dirac_order = QUDA_DIRAC_ORDER;

Expand Down Expand Up @@ -2248,11 +2252,13 @@ void spinTasteQuda(void *h_out, void *h_in, int spin_, int taste, QudaInvertPara
profileCovDev.TPSTOP(QUDA_PROFILE_TOTAL);
}

void covDevQuda(void *h_out, void *h_in, int dir, QudaInvertParam inv_param)
void covDevQuda(void *h_out, void *h_in, int dir, QudaInvertParam *param)
{
profileCovDev.TPSTART(QUDA_PROFILE_TOTAL);
profileCovDev.TPSTART(QUDA_PROFILE_INIT);

QudaInvertParam &inv_param = *param;

const auto &gauge = *gaugePrecise; //(inv_param->dslash_type != QUDA_ASQTAD_DSLASH) ? *gaugePrecise : *gaugeFatPrecise;

inv_param.solution_type = QUDA_MAT_SOLUTION;
Expand Down
4 changes: 2 additions & 2 deletions lib/milc_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ void qudaShift(int external_precision, int quda_precision, const void *const lin
if ((sym < 1) || (sym > 3)) {
printf("Wrong shift. Select forward (1), backward (2) or symmetric (3).\n");
} else {
shiftQuda(dst, src, dir, sym, invertParam);
shiftQuda(dst, src, dir, sym, &invertParam);
}

qudamilc_called<false>(__func__, verbosity);
Expand Down Expand Up @@ -1354,7 +1354,7 @@ void qudaSpinTaste(int external_precision, int quda_precision, const void *const
}
invertParam.dslash_type = saveDslash;

spinTasteQuda(dst, src, spin, taste, invertParam);
spinTasteQuda(dst, src, spin, taste, &invertParam);

qudamilc_called<false>(__func__, verbosity);
} // qudaSpinTaste
Expand Down

0 comments on commit 92e6bf8

Please sign in to comment.