codee-com / open-catalog

This Open Catalog is a collaborative effort to consolidate expert knowledge on best practices for modernizing and optimizing code written in C, C++, and Fortran programming languages.
Apache License 2.0
79 stars 7 forks source link

Add PWR062: Consider loop interchange by removing accumulation on array value #12

Closed alvrogd closed 6 months ago

alvrogd commented 6 months ago

Add entry and benchmarks. My results:

$ gcc --version                  
gcc (Debian 12.2.0-14) 12.2.0

$ gfortran --version                
GNU Fortran (Debian 12.2.0-14) 12.2.0
------------------------------------------------------------------
Benchmark                        Time             CPU   Iterations
------------------------------------------------------------------
PWR062 C Example              1110 us         1110 us          635
PWR062 C Improved              429 us          429 us         1608
PWR062 Fortran Example         959 us          959 us          729
PWR062 Fortran Improved        275 us          275 us         2645