Announcement

Collapse
No announcement yet.

LLVM Flang Begins Seeing NVIDIA CUDA Fortran Support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LLVM Flang Begins Seeing NVIDIA CUDA Fortran Support

    Phoronix: LLVM Flang Begins Seeing NVIDIA CUDA Fortran Support

    The LLVM Fortran compiler "Flang" has begun seeing NVIDIA CUDA support land in the upstream code-base...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    So, what about Fortran makes it better than alternatives for scientific calculations? I just don't get how it has remained relevant after all this time, especially to the point that it gets CUDA support.

    Comment


    • #3
      Originally posted by schmidtbag View Post
      So, what about Fortran makes it better than alternatives for scientific calculations? I just don't get how it has remained relevant after all this time, especially to the point that it gets CUDA support.
      I don't think it's so much a case of being "better". It's more likely a case of FORTRAN code being more widespread among a large scientific userbase.

      If you already know how to program in FORTRAN to meet your needs you probably continue that way to remain productive in your work. You can spend your spare time dabbling in other languages.

      Also, if you have an installed base of production FORTRAN code you tend to stick with it in scientific applications since "stable production" is more important than "newfangled gee-whiz". Again, you can dabble in other languages, perhaps slowly introduce them after thorough testing, but forklift upgrades tend to be frowned upon due to the debugging efforts required to port the code from FORTRAN to whatever. In other words, migration from FORTRAN will likely be slow, even glacial, since stable production code, earned through meritocracy, is highly valued.

      Comment


      • #4
        Originally posted by schmidtbag View Post
        So, what about Fortran makes it better than alternatives for scientific calculations?
        • It's a relatively easy language to learn, and particularly if you program in the "modern" style (a.k.a post-Fortran 90) there are not that many footguns.
        • Restrict-style procedure argument semantics by default, making it easier for the optimizer to generate fast loops.
        • Native support for multidimensional arrays, with Numpy/MATLAB style array syntax. (If you take array syntax as a hard requirement, and also compilation to native code, well suddenly there's not that many players left on the field)

        Practically, a big reason for choosing to learn Fortran is if your work requires you to add a feature to an existing simulation program that happens to be written in Fortran. Or you work in a research group where Fortran is heavily used.

        As for why you shouldn't learn Fortran, well, Fortran is pretty much confined to its niche of numerical programming (although in principle it's a general purpose language). You won't find much libraries outside that core domain. And similarly, Fortran isn't really a marketable skill. Even in the subfields in academia that are heavy Fortran users, nobody is going to give a shit if you put Fortran on your CV, publications is (almost) all that matters. In academia the expectation is that if you need Fortran you'll pick it up on the job. So if you're, say, a PhD student tasked with writing some new simulation program, it might make sense to invest in learning C++, even though the learning curve is higher and steeper than for Fortran, just because if you ever leave academia (which, given the way the academic job market works, is highly likely) having C++ on your CV might be useful if you decide to go for industry jobs where high performance programming skills are valued.

        I just don't get how it has remained relevant after all this time, especially to the point that it gets CUDA support.
        CUDA Fortran was originally a product of the Portland Group, a company making a compiler suite. Eventually Portland Group was bought by NVIDIA, and now NVIDIA is contributing to the new LLVM Fortran frontend (flang), so this is probably part of that effort, moving missing features from the old PG Fortran frontend to flang.
        Last edited by jabl; 05 June 2023, 07:02 AM.

        Comment


        • #5
          jabl Thanks much for the detailed and not condescending response. That's a rarity around here.

          Comment

          Working...
          X