Trying to use single or mixed precision
Hi,
in issue #158 (closed) the conjecture was made that trying to compile with real_t = float
would break many things. Guess what, that's true
- There are many warnings on narrowing conversions
conversion to ‘walberla::real_t {aka float}’ from ‘double’ may alter its value [-Wfloat-conversion]
as we do not consistently make use ofreal_c()
and have many double literals in the code. - A major problem is that all the FEniCS forms are generated for double. Thus, we cannot call
gen.tabulate_tensor()
and pass it an array of floats. - But also in HyTeG itself the generated kernels seem to all use double.
- Some things also get explicitly instantiated only for double, like e.g.
EdgeDoFPackInfo
. But I did not look deeper into this.
With respect to mixed precision I also attempted to instantiate a VectorDoFFunction<float>
while compiling with real_t = double
. That at least compiles, but the linker cannot satisfy all dependencies. Likely here we would need to explicitly instantiate other stuff for float
then, too. Like e.g. float hyteg::generateZero<float>()
.
Cheers
Marcus
Edited by Marcus Mohr