12 #include <nvToolsExt.h> 22 : B(B), Nvec(Nvec), V_h(0), V_d(0), fine_tmp_h(0), fine_tmp_d(0), coarse_tmp_h(0), coarse_tmp_d(0), geo_bs(0),
23 fine_to_coarse_h(0), coarse_to_fine_h(0),
24 fine_to_coarse_d(0), coarse_to_fine_d(0),
26 enable_gpu(enable_gpu), use_gpu(enable_gpu),
27 flops_(0), profile(profile)
29 int ndim =
B[0]->Ndim();
31 for (
int d = 0;
d <
ndim;
d++) {
46 this->geo_bs =
new int[
ndim];
47 int total_block_size = 1;
48 for (
int d = 0;
d <
ndim;
d++) {
53 if (total_block_size == 1)
errorQuda(
"Total geometric block size is 1");
58 printfQuda(
"Transfer: using block size %s\n", block_str);
66 param.nSpin =
B[0]->Nspin();
86 printfQuda(
"Transfer: filling V field with zero\n");
122 if (
param.nSpin != 1){
128 printfQuda(
"Transfer: block orthogonalizing\n");
133 printfQuda(
"Transferred prolongator to GPU\n");
192 errorQuda(
"Undefined site_subset %d", site_subset_);
207 return (
x <
a.x) ? true : (
x==
a.x &&
y<
a.y) ?
true :
false;
239 std::vector<Int2> geo_sort(
B[0]->Volume());
241 std::sort(geo_sort.begin(), geo_sort.end());
255 for (
int s=0;
s<
B[0]->Nspin();
s++) {
283 errorQuda(
"Cannot prolongate to a full field since only have single parity null-space components");
285 if ((
V->Nspin() != 1) && ((output->
GammaBasis() !=
V->GammaBasis()) || (input->
GammaBasis() !=
V->GammaBasis()))){
286 errorQuda(
"Cannot apply prolongator using fields in a different basis from the null space (%d,%d) != %d",
323 errorQuda(
"Cannot restrict a full field since only have single parity null-space components");
325 if (
V->Nspin() != 1 && ( output->
GammaBasis() !=
V->GammaBasis() || input->
GammaBasis() !=
V->GammaBasis() ) )
326 errorQuda(
"Cannot apply restrictor using fields in a different basis from the null space (%d,%d) != %d",
#define qudaMemcpy(dst, src, count, kind)
void OffsetIndex(int &i, int *y) const
QudaVerbosity getVerbosity()
void R(ColorSpinorField &out, const ColorSpinorField &in) const
const ColorSpinorField & Even() const
const ColorSpinorField & Odd() const
static ColorSpinorField * Create(const ColorSpinorParam ¶m)
QudaGammaBasis GammaBasis() const
void P(ColorSpinorField &out, const ColorSpinorField &in) const
ColorSpinorField * fine_tmp_h
void setSiteSubset(QudaSiteSubset site_subset, QudaParity parity)
Sets whether the transfer operator is to act on full fields or single parity fields, and if single-parity which parity. If site_subset is QUDA_FULL_SITE_SUBSET, the transfer operator can still be applied to single-parity fields, however, if site_subset is QUDA_PARITY_SITE_SUBSET, then the transfer operator cannot be applied to full fields, and setSiteSubset will need to be called first to reset to QUDA_FULL_SITE_SUBSET. This method exists to reduce GPU memory overhead - if only transfering single-parity fine fields then we only store a single-parity copy of the null space components on the device.
ColorSpinorField * coarse_tmp_d
void FillV(ColorSpinorField &V, const std::vector< ColorSpinorField *> &B, int Nvec)
QudaSiteSubset site_subset
void createGeoMap(int *geo_bs)
ColorSpinorField * coarse_tmp_h
void Restrict(ColorSpinorField &out, const ColorSpinorField &in, const ColorSpinorField &v, int Nvec, const int *fine_to_coarse, const int *coarse_to_fine, const int *spin_map, int parity=QUDA_INVALID_PARITY)
Apply the restriction operator.
enum QudaParity_s QudaParity
cudaError_t qudaDeviceSynchronize()
Wrapper around cudaDeviceSynchronize or cuDeviceSynchronize.
#define safe_malloc(size)
enum QudaSiteSubset_s QudaSiteSubset
ColorSpinorField * CreateCoarse(const int *geoblockSize, int spinBlockSize, int Nvec, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION)
QudaFieldLocation location
cpuColorSpinorField * out
int sprintf(char *, const char *,...) __attribute__((__format__(__printf__
void fillV(ColorSpinorField &V)
Transfer(const std::vector< ColorSpinorField *> &B, int Nvec, int *geo_bs, int spin_bs, bool enable_gpu, TimeProfile &profile)
#define device_malloc(size)
void LatticeIndex(int *y, int i) const
bool operator<(const Int2 &a) const
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
ColorSpinorField * fine_tmp_d
void createSpinMap(int spin_bs)
void BlockOrthogonalize(ColorSpinorField &V, int Nvec, const int *geo_bs, const int *fine_to_coarse, int spin_bs)
Block orthogonnalize the matrix field, where the blocks are defined by lookup tables that map the fin...
const std::vector< ColorSpinorField * > & B
static __inline__ size_t size_t d
void Prolongate(ColorSpinorField &out, const ColorSpinorField &in, const ColorSpinorField &v, int Nvec, const int *fine_to_coarse, const int *spin_map, int parity=QUDA_INVALID_PARITY)
Apply the prolongation operator.