M
Modular11mo ago
Aydyn

Is it possible to use gcc like compiler flags? (ex. -ffast-math)

Some solutions implemented on C & Zig uses compiler flags to achieve tangible perfromance boost when leveraging compiler flags for optimiations. gcc (-Ofast):
gcc -Ofast
gcc -Ofast
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html >> Disregard strict standards compliance. -Ofast enables all -O3 optimizations. It also enables optimizations that are not valid for all standard-compliant programs. It turns on -ffast-math, -fallow-store-data-races and the Fortran-specific -fstack-arrays, unless -fmax-stack-var-size is specified, and -fno-protect-parens. It turns off -fsemantic-interposition. Or Zig
...one important optimization: @setFloatMode(.Optimized)
It has about the same effect as setting -ffast-math in the C version.
...one important optimization: @setFloatMode(.Optimized)
It has about the same effect as setting -ffast-math in the C version.
https://github.com/karpathy/llama2.c/issues/432#issuecomment-1774922109 How to tune mojo compiler to achieve similar results?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server