lattice / quda

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

Idiot-proofing the color-spinor fields #62

Closed jpfoley closed 12 years ago

jpfoley commented 12 years ago

This is an irksome interface issue, which I'm sure will be dealt with once the SC rush is over. But I spent an hour trying to understand why my code was giving an error, so I feel like raising the issue anyway. My problem arose because I was calling the cudaColorSpinorField constructor with a ColorSpinorParam argument. The issue was that the ColorSpinorParam object had its fieldLocation initialised to QUDA_CPU_FIELD_LOCATION upon instantiation. Since I passed the colorSpinorParam to the constructor, I ended up with a cudaColorSpinorField object with a QUDA_CPU_FIELD_LOCATION, resulting in an error later in the code.

maddyscientist commented 12 years ago

Infuriating I bet. Good point to raise this though.

maddyscientist commented 12 years ago

I am working on this as part of clean up to allow qdp-jit to communicate directly with QUDA. I will actually remove the location from the ColorSpinorField, and use typeid solely from now on (what I should I have done from day 1). This will prevent a field from accidentally thinking it's on the host when it's actually on the device etc.