Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain operations involving SitePropagator::scalar_object won't compile with CUDA for Nc > 3 #413

Open
edbennett opened this issue Oct 5, 2022 · 0 comments

Comments

@edbennett
Copy link
Contributor

In trying to understand aportelli/Hadrons#94, it transpires that certain arithmetic operations in Grid will not compile for SU(4).

For example, the following test program gives two build errors, one caused by line 6 and one by line 15:

#include <Grid/Grid.h>

using namespace Grid;

void test(WilsonImplR::PropagatorField &out, WilsonImplR::ComplexField in, const WilsonImplR::SitePropagator::scalar_object idMat) {
  out = in * idMat;
}

void test2(WilsonImplR::SitePropagator::scalar_object sp1,
	   WilsonImplR::PropagatorField pf1,
	   WilsonImplR::PropagatorField pf2,
	   Gamma g1,
	   Gamma g2)
{
  LatticeComplex out = trace(g1 * sp1 * adj(pf1) * (g1 * g2) * pf2);
}

In both cases, using an auto declaration works, but then assigning back to the desired type re-triggers the error, so the cast appears to be at least part of the problem.

I compiled with:

nvcc -x cu -I${HOME}/prefix_su4test/include -ccbin mpicxx -I${HOME}/prefix/include --expt-extended-lambda -c -o test.o test.cpp

These examples compile fine for SU(3), and also work fine with SU(4) compiled for CPU.

Is this something that it would be possible to fix, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant