Remix.run Logo
thatjoeoverthr 4 days ago

Of course I could in C.

Intel and Nvidia are both offering both C and Fortran compilers, so I was looking at both. I know C well but I decided to not look at it as a presumed default.

When I used C like this in the past, the intrinsics were very low-level, e.g. wrapping specific Altivec or SSE instructions or whatever. I see see it has OpenMP intrinsics, though, which I’m sure I’ll try later.

If I use a library, I’m breaking up the operations and don’t give the optimizing compiler an opportunity to take operations into account together.

With Fortran, I can give the operations directly to the compiler, tell it the exact chip I’m working with and it deals with it.

It would be fun, when I have some time, to go rewrite it in C and see how it compares.