Easily make all variables 32 bit?

Hello,
is there some way to force all implicitly declared variables from 64 to 32 bit? I know I can explicitly declare stuff as 32bit and write numbers as 1.0f0. But I’d like to test the accuracy I lose in my 64 bit code (and performance I gain) when running in 32 bit mode (same hardware) without having to rewrite every single number and explicitly declare every single variable. Obviously, I’m expecting I’ll have to modify everything that is explicitly declared.
Some global var or setting maybe?
Thanks a lot!

It sounds like https://github.com/stevengj/ChangePrecision.jl should fit your use case.

3 Likes

Yep, sounds like it’s exactly what I need! Thanks!