|
|
|
|
|
by extraduder_ire
85 days ago
|
|
Have you tried using the restrict keyword everywhere you can in c? In Fortran, arrays are not allowed to overlap which allows some optimisations. c has rules in the spec about how memory accesses must occur, and overlapping arrays being possible prevents some compiler optimisations. The restrict keyword is you promising that the memory at some pointer won't be accessed through another pointer. You can compare two implementations in Fortran/c using godbolt to see how each of them compile. |
|