Closed garth-wells closed 1 year ago
I don't find it is wrong. I tried ffcx --scalar_type=float Poisson.py
and it contains fabsf
. Maybe it depends how it is called - from Python I guess it may not be passing scalar_type properly? Can you provide an example?
I don't find it is wrong. I tried
ffcx --scalar_type=float Poisson.py
and it containsfabsf
. Maybe it depends how it is called - from Python I guess it may not be passing scalar_type properly? Can you provide an example?
I'll dig out the test that generated the compiler warnings.
I think I have found the problem here - not so much with float
but with complex
- the code generator assumes that all math functions should be appropriate for the scalar type (e.g. complex), but the geometry is never complex, so using e.g. cabs()
is wrong, and generates a compiler warning. I think this could be fixed e.g. with a "typing" system for CNodes Symbol
but that will require quite a bit of work.
Fixed in #594
For
float
, FFCx generates code that usesfabs
but it should usefabsf
for floats. Same is likely for other math functions.Need to check and use correct functions.