Feature Story


More feature stories by year:

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998

Return to: 2016 Feature Stories

CLIENT: HSA FOUNDATION

June 5, 2016: IEEE Computing Now

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.

Wrap-Up

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/.

Return to: 2016 Feature Stories