HSA Gains HSAIL Support

Sept. 4, 2013
AMD’s Heterogeneous System Architecture (HSA) moves closer to reality with the HSA Intermediate Language (HSAIL) support.
Download this article in .PDF format
This file type includes high resolution graphics and schematics when applicable.

AMD’s Heterogeneous System Architecture (HSA) is the floorplan for its next generation of accelerated processing units (APUs), which combine the CPU and GPU into a common memory environment (see “Unified CPU/GPU Memory Architecture Raises The Performance Bar”) via a cache-coherent shared virtual memory (CC-SVM). The original APU combined CPU and GPU cores but maintained distinct memory for each type of core (see “APU Blends Quad Core x86 With 384-Core GPU”).

Related Articles

OpenCL 2.0 addresses CPU and GPU parallel processing environments (see “OpenCL 2.0, OpenGL 4.4 Officially Released”). Normally, the environment has a unique address space for the GPU. This model is also used for some FPGA-based OpenCL environments (see “How To Put OpenCL Into An FPGA”), but HSA is different because it has a unified memory environment. The Heterogeneous System Architecture Intermediate Language (HSAIL) and associated design environment were developed to take advantage of HSA. Frameworks like OpenCL can generate HSAIL that can run on a virtual machine that targets CPU/GPU cores.

HSAIL divides work into a grid hierarchy (Fig. 1). Like OpenCL, programmers define kernels that can be run in parallel on data. The big difference is that HSAIL essentially maps to an HSA-based virtual machine. The HSA finalizer is akin to the JIT (just-in-time) compilation for a Java virtual machine (JVM).

Figure 1. HSAIL divides work into a grid, work group, and work items.

The HSAIL virtual machine consists of at least one host CPU and an HSA component. The Architected Queue Language (AQL) links the two. The host generates and enqueues AQL packets. The packets incorporate kernels that are executed by the HSA component. A kernel defines a multidimensional cube-shaped grid with a work-group item per grid point. Jobs are dispatched as work groups. They require all data to be available.

AMD would like HSA to be a standard so HSAIL is open, but for now it will take advantage only of AMD’s HSA-based hardware. It may be wishful thinking that Intel would incorporate it, although an integrated CPU/GPU/memory environment has advantages and AMD and Intel have at least agreed upon the x86 instruction set. HSAIL could be applied to an ARM environment. It is interesting to note that ARM is one of the founding members of the HSA Foundation along with AMD, Samsung, Qualcomm, MediaTek, Imagination, and Texas Instruments.

Another aspect of HSAIL and HSA is Java support (Fig. 2). APARAPI (A PARallel API) is one way for Java to support parallel programming environments. It typically maps to OpenCL, but it could target an HSAIL finalizer.

Figure 2. APARAPI allows Java to utilize parallel processing infrastructures like HSAIL. Project Sumatra will provide a more flexible parallel programming environment.

APARAPI eventually may be replaced by OpenJDK’s Project Sumatra, which brings native parallel programming support to Java. Project Sumatra also could target HSAIL directly. Oracle and AMD are involved with Project Sumatra, so this combination may wind up in production. Support is targeted for Java 9.

Developers can leverage the HSA architecture using the BOLT library from AMD. The C++ template library inspired BOLT, which also has been targeted at OpenCL and C++AMP.

OpenCL and Project Sumatra will remain the primary programming environments for programmers, but HSA can provide a better infrastructure. The unified memory architecture eliminates unnecessary copy operations since pointers can be shared between CPU and GPU cores. The approach also has a lower dispatch overhead.

For now, AMD’s hardware will be driving HSAIL development and the software that runs on top of it. In the future, it could be much more.

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!