lattice / quda

QUDA is a library for performing calculations in lattice QCD on GPUs.
https://lattice.github.io/quda
Other
294 stars 100 forks source link

Setting gauge field scale for floating point types #1508

Open jcosborn opened 4 weeks ago

jcosborn commented 4 weeks ago

The test suite sets scale for the staggered gauge field parameters (https://github.com/lattice/quda/blob/develop/tests/utils/set_params.cpp#L100) which then gets set for both the fat and long link gauge fields. These are initially floating point fields, but the code (https://github.com/lattice/quda/blob/develop/include/lattice_field.h#L229) implies it should only be set for fixed point fields, and it likewise seems to be ignored for floating point fields. This leads to an inconsistency when the fields are copied to half precision, since this is still set and now Accessor will honor the scale (https://github.com/lattice/quda/blob/develop/include/gauge_field_order.h#L644) whereas it didn't in the floating point version.

Should setting scale on floating point fields be rejected (i.e. require scale = 1.0), or should it be allowed on all precisions and likewise taken into account in Accessor?

Also, LinkMax is not used in Accessor, but only in Reconstruct. Should that be used in Accessor too?