The AMD AOCC 6.0 compilers were released on 11/10. These include both the old amdflang compilers and the new aof/aoc compilers based on LLVM 21.1.8. see
OK so then we now have amdflang(rocm), amdflang (afar), flang (aocc), aomp (rocm) and aof (aocc)? Not to mention flang (llvm)?
It would be nice if AMD merged their compilers to just have aof be “the” AMD compiler that does both optimized CPU and GPU offload…
Agree. Appears AMD is going out of their way to be confusing. I’m just going to stick with aof since its close to the latest LLVM flang.
Seems like a few years ago we didn’t have any flangs and now we have a dozen. Progress? ![]()
To paraphrase an old song from many many years ago, apparently
“It don’t mean a thang if you don’t have a flang” ![]()
Usually the project structure reflects the internal company structure, so I am guessing 5 AMD compilers means they have 5 different teams for Fortran. ![]()
First attempt at the new AOCC compilers: flang works with my test program kinds03.f90, but aof won’t compile it, saying
(lf) john:~/AMD/aocc-compiler-6.0.0/bin$ ./aof ~/Test/kinds03.f90 && ./a.out
error: loc("/home/john/Test/kinds03.f90":303:5): /aocc/llvm-project/flang/include/flang/Optimizer/Support/Utils.h:127: not yet implemented: intrinsic: REAL(KIND=2) in EXPONENT
LLVM ERROR: aborting
Yes. REAL16 does not appear to be supported yet. However, REAL80 (from ISO_FORTRAN_ENV) appears to work. I don’t know though if it just defaulted to REAL128 or REAL64.
Edit.
REAL80 has a value of 10 so I guess its actually represents 80 bit reals. I really wish they didn’t adopt the kind value = number of bytes of storage format but I understand why (backwards compatibility). I just think letting REAL32/REAL64 and INT32/INT64 both have a value of 4/8 is a mistake that should never have been allowed.
On commenting out with !! in several places in my program things relevant to exponent(x) where x is Infinity, I find that aof implements real kinds 2,4,8,10,16 but it has not implemented exponent(x) where x is real(2).
Here is the program kinds03noexp.f90
kinds03noexp.f90 (20.9 KB)
I have been using versions of that program for years to print various properties of the available real and integer kinds with every compiler I could try. It’s 446 lines long. With the aof compiler I got 53 lines of output.
Yes, REAL16 appears to be supported in ISO_FORTRAN_ENV but not in some intrinsic functions like EXPONENT and MAXVAL and I presume others.
This is what I already know, we will get there.
not yet implemented: intrinsic: {COMPLEX(KIND=16), COMPLEX(KIND=16)} in MATMUL
not yet implemented: intrinsic: {COMPLEX(KIND=2), COMPLEX(KIND=2)} in MATMUL
not yet implemented: intrinsic: COMPLEX(KIND=2) in DOTPRODUCT
not yet implemented: intrinsic: COMPLEX(KIND=2) in PRODUCT
not yet implemented: intrinsic: COMPLEX(KIND=2) in SUM
not yet implemented: intrinsic: {INTEGER(KIND=4), INTEGER(KIND=4)} in MATMUL
not yet implemented: intrinsic: {REAL(KIND=16), REAL(KIND=16)} in MATMUL
not yet implemented: intrinsic: REAL(KIND=2) in BESSEL_JN
not yet implemented: intrinsic: REAL(KIND=2) in BESSEL_YN
not yet implemented: intrinsic: REAL(KIND=2) in DOTPRODUCT
not yet implemented: intrinsic: REAL(KIND=2) in ERFC_SCALED
not yet implemented: intrinsic: REAL(KIND=2) in EXPONENT
not yet implemented: intrinsic: REAL(KIND=2) in FRACTION
not yet implemented: intrinsic: REAL(KIND=2) in MAXLOC
not yet implemented: intrinsic: REAL(KIND=2) in MAXVAL
not yet implemented: intrinsic: REAL(KIND=2) in MINLOC
not yet implemented: intrinsic: REAL(KIND=2) in MINVAL
not yet implemented: intrinsic: REAL(KIND=2) in MOD
not yet implemented: intrinsic: REAL(KIND=2) in MODULO
not yet implemented: intrinsic: REAL(KIND=2) in NORM2
not yet implemented: intrinsic: REAL(KIND=2) in PRODUCT
not yet implemented: intrinsic: REAL(KIND=2) in RANDOM_NUMBER
not yet implemented: intrinsic: REAL(KIND=2) in RRSPACING
not yet implemented: intrinsic: REAL(KIND=2) in SET_EXPONENT
not yet implemented: intrinsic: REAL(KIND=2) in SUM
not yet implemented: intrinsic: {REAL(KIND=2), REAL(KIND=2)} in MATMUL
Let me add some details here:
- AFAR is the “experimental” branch of the ROCm compilers. So, you cannot really count these as two compilers; the AFAR just ships early what ROCm will have later in time. I would count these as the same compiler.
- AOMP is gone.
- AOCC with
flangis superseded byaofwithaofbeing based on the LLVM Flang compiler.
Counting upstream LLVM as an AMD compiler is flattering, but does not count into the list of compilers that are produced by AMD.
So, with my count, we are down to two. ![]()
Guess I should update my slides on the plane ![]()
Ellington’s fine. But when I read “old song”, somehow Outkast (and the most exhausting video ever made,
) came to my mind:
Don’t put the flang out, unless you plant to flang!
But didn’t NAG do the opposite? I mean, they had a sequence for kinds and changed it to bytes, didn’t they? The advantage of bytes-based kinds is that you don’t need to read the compiler’s manual to know what “3” means depending on the type.
Yes, NAG is the only one I know of that doesn’t use byte-based kinds. However, my position has always been that hardwiring the kind size (ie real(8) or even worse IMHO real*8) is not the best programming practice. Even before REAL32, REAL64 etc were included in ISO_FORTRAN_ENV, you could always use SELECTED_REAL_KIND to create a “label” for a kind type so you never had to worry about what its actual value was. I believe the standard is explicit about not demanding a particular value for each kind which is the path NAG took. My biggest issue is that when INT32/INT64 and REAL32/REAL64 have the same value (4 or 8) then you can never implement a modification to PDTs (if we ever get a bullet proof PDT in any compiler) that would allow you to do the following
type generic_array_t(this_kind)
integer, kind :: this_kind
type(this_kind), allocatable :: generic_array(:)
end type
type(generic_array_t(REAL64)) :: double_array
type(generic_array_t(INT64)) :: int64_array
Note that the following use of type to define intrinsic types was introduce in F2008 (I think)
type(real(REAL64)) :: double
However, this is so clunky in my opinion why would anyone ever use it. Just having type(REAL64) would be clearer (but again not very useful outside the hypothetical PDT i give above). If it was mandated that REAL64 and INT64 could not have the same value (8) then the mod I outline above could be implemented and we could have a more flexible PDT (again if we ever got an implementation that was bullet-proof). As it is now this is impossible. Unfortunately, the current kind facility is so ingrained in most modern Fortran codes it can never (and probably shouldn’t at this point in time) be changed. I see this as another example of previous iterations of the Standard Committee lacking foresight and dropped the ball.
My point was that NAG does. I think there’s a flag to switch from 1, 2, 3 to 4, 8, 16 —my sycophant-LLM-of-the-day seems to confirm/hallucinate it, hehehe.
After trying PDTs many times, but ultimately hitting a wall and doing something else, I’m now convinced that PDTs are conceptually broken… it only took us 20+ years to find that out.
That’s useful for generated code, and it also unifies the syntax into the tyoe-guard of the select-type-construct.
I think it is a chicken-or-the-egg problem. Compilers don’t implement the feature because programmers don’t use it, and programmers don’t use it because compiler don’t implement it.
I’m not a compiler writer, but I don’t see anything wrong with the feature design. It is not ambiguous, and a human can look at the code and understand what the programmer intends. I would have used the feature many times in the last 20 years if only it were reliable across the compilers I use.
Salford/Silverfrost too.
The quality of implementation(s) is indeed an issue.
And maybe I’m using it wrong? But by definition, each set of parameters produces a different type, so if your instances happen to have different parameters, you’ll end up either overloading unnecessarily, or doing extra work (work that the non-parameterized version would get for free).
And even though the possibility of default initializaiton is a nice thing, there might be stack-related issues.