3 ms·
which flags did you use and which compiler version?
by mshockwave 2y ago
which flags did you use and which compiler version?
- QuadmasterXLII 2y agoclang 19, -O3 -ffast-math -march=native
- mshockwave 2y agocan confirm fast math makes the biggest difference
- mkristiansen 2y agoFast Math basically means "who cares about standards just add in whatever order you want" :)
- QuadmasterXLII 2y agoI feel like I’m kinda being the bad aunt by encouraging -ffast-math. It can definitely break some things (i.e. https://pspdfkit.com/blog/2021/understanding-fast-math/ https://pspdfkit.com/blog/2021/understanding-fast-math/ ) but I use it habitually and I’m fine so clearly it’s safe.
- magicalhippo 2y ago> It can definitely break some things I recall it totally fudged up the ray-axis aligned bounding box intersection routine in the raytracer I worked on. The routine relied on infinities being handled correctly, and -ffast-math broke that. I see the linked article goes into that aspect in detail, wish I had it back then. IIRC we ended up disabling it for just that file, as it did speed up the rest my a fair bit.
- hansvm 2y agoI would love a fast-math implementation which handled inf correctly, but no language/compiler seems to care.