Trixi.jl icon indicating copy to clipboard operation
Trixi.jl copied to clipboard

Apply `@muladd` more specifically?

Open ranocha opened this issue 1 year ago • 6 comments

I'm just annoyed again by Revise not playing nicely with @muladd when struct definitions are included. What do you think about applying @muladd more specifically to function definitions where it makes sense?

ranocha avatar Aug 11 '22 06:08 ranocha

Is there really no other way to enable muladd globally? Are you able to estimate how many functions would be affected?

sloede avatar Aug 11 '22 07:08 sloede

Alternatively, we could try to move all type definition out of the @muladd blocks.

ranocha avatar Aug 11 '22 07:08 ranocha

Alternatively, we could try to move all type definition out of the @muladd blocks.

I feel like this is even worse. That would force us to rearrange code in files only for performance considerations. I think in this case I'd rather have @muladd added to individual functions, although we should make clear whether it goes before or after @inline

sloede avatar Aug 11 '22 07:08 sloede

Is there really no other way to enable muladd globally?

I don't see another way right now...

Are you able to estimate how many functions would be affected?

Probably everything that does non-trivial computations - quite a lot, I guess?

ranocha avatar Aug 11 '22 07:08 ranocha

Would delaying adding muladd for files with experimental features make sense? Revise and muladd have been annoying for me too, but removing the muladd blocks during development has largely fixed that.

jlchan avatar Aug 11 '22 11:08 jlchan

That would help when adding new files but

  • we would need to remember adding it in time
  • it doesn't help with already existing files, e.g., for #1205

ranocha avatar Aug 11 '22 13:08 ranocha