SUSE Developers Publish Radeon GCN Backend Code For GCC Compiler

Martin Jambor and Jan Hubicka are among the developers working on the GCN back-end for GCC that's now been made public. Jambor commented on the GCN back-ends current capabilities, "At this point, the back-end can compile small kernels open-coded in C with target-specific attributes, built-ins and address spaces to make use of the various special characteristics of the architecture. Eventually, it should of course provide for high-level programming models, most notably OpenMP, but the list of steps we need to take before we get there is very long."
So far this GCC GCN support has just been tested with AMD APUs and not yet any discrete graphics cards. With this current code you also need to use the AMDGPU LLVM assembler. Other requirements on using this GCC back-end code is a ROCK kernel, ROCT thunk library, ROCR run-time library, amdphdrs utility, and other code not yet readily available on most Linux distributions.
Once you have obtained their GCC GCN code and all of the code requirements, you can compile the basic kernels into Assembly, feed that Assembly into the llvm-mc AMDGCN assembler, and then use the amdphdrs utility to convert that into AMD HSA object code, which can then be loaded and executed by the ROCR run-time.
The basic details for now can be found via this GCC announcement. They will be working on more documentations / guide shortly for those interested. Hopefully we'll see the code mature to the point where it will be found in next year's GCC 8 release.
6 Comments