HSA Connections - Home
ROCm: Do You Speak My Language?
Ben Sander
JUN 06, 2016 03:14 AM
A+ A A-

ROCm: Do You Speak My Language?

The open-source ROCm stack offers several programming-language choices designed to give you a range of developer tools. Some of the options include:

·       Heterogeneous Compute Compile (HCC) – benefits include ease of development and full control over the machine;

·       Heterogeneous-Computing Interface for Portability (HIP) – A C++ dialect that eases conversion of CUDA apps into portable C++ code; it provides a C-style API and C++ kernel language.  Use it for converting CUDA apps to portable C++ and for new projects requiring portable between AMD and Nvidia.

·       C++AMP (Accelerated Massive Parallelism) – A C++ language for data-parallel programming. It’s a useful C++ API for accelerated GPU computing and an excellent way to learn HC mode, since they share a common heritage and multiple data structures.

·       OpenCL™ (Open Compute Language) – A popular framework for developing programs that can be used across a wide variety of heterogeneous platforms. Use it when you have existing OpenCL code and when portability to multiple platforms is essential. It runs on Windows, Linux, Mac OS and an array of hardware platforms.

Where Is HSA?

As a brief recap, the HSA specifications define a set of hardware requirements (for such things as shared virtual memory, signals, standard packet format and command-queue interfaces, and context switching).

HSA also has two software specifications: one that describes the HSA Runtime API and another that describes the HSAIL portable intermediate language. These two are the building blocks for the higher-level languages. The ROCr API is essentially the HSA Runtime API plus extensions for discrete GPUs and peer-to-peer communication.

HSA is an excellent platform for language run times to build on. The ROCR memory-management API provides explicit control over data movement and dependencies. HSA has a low-level dispatch API that gives languages considerable control over the dispatch path. The run time also provides a clean separation between the pre-finalization (before HSAIL) and the post-finalization (after HSAIL) steps.

The HCC compiler now comes in two versions: one that generates HSAIL (which, in its final form, is GPU ISA code) and one that directly generates GCN ISA code. We plan to focus more on the direct-to-ISA path, for which we have a single compiler with a view of the entire compilation process from parsing the source to generating the machine code.


From a high-level tools perspective, the HCC (Heterogeneous Compute Compiler) supports HC and C++AMP dialects. HIP is a run-time library that layers on top of HCC (for AMD ROCm platforms; for Nvidia, it uses the NVCC compiler). HCC, HIP and the supporting ROCm driver stack are available now; all are open-source projects, so you can employ a fully open stack from the language down to the metal. AMD, an HSA Foundation member, is committed to providing an open ecosystem that gives developers the ability to choose; we are excited about innovating quickly using open source and about interacting closely with our developer community.

For a more detailed write-up on ROCm, see: http://gpuopen.com/rocm-do-you-speaka-my-language/.

Ben Sander is a Senior Fellow at AMD and the lead software architect for the Boltzmann Initiative and HSA projects. He has held a variety of management and leadership roles during his career at AMD including positions in CPU micro-architecture, performance modeling, and GPU software development and optimization.

[%= name %]
[%= createDate %]
[%= comment %]
Share this:
Please login to enter a comment:

Computing Now Blogs
Business Intelligence
by Drew Hendricks
by Keith Peterson
Cloud Computing
A Cloud Blog: by Irena Bojanova
The Clear Cloud: by STC Cloud Computing
Computing Careers: by Lori Cameron
Display Technologies
Enterprise Solutions
Enterprise Thinking: by Josh Greenbaum
Healthcare Technologies
The Doctor Is In: Dr. Keith W. Vrbicky
Heterogeneous Systems
Hot Topics
NealNotes: by Neal Leavitt
Industry Trends
Internet Of Things
Sensing IoT: by Irena Bojanova
Software Technologies: by Christof Ebert