TMCnet News

Khronos Releases SPIR 1.2 Specification for Portable Encoding of OpenCL Device Programs
[January 21, 2014]

Khronos Releases SPIR 1.2 Specification for Portable Encoding of OpenCL Device Programs


VIENNA --(Business Wire)--

The Khronos™ Group today announced the ratification and public release of the SPIR™ 1.2 specification that provides a non-source encoding, and binary level portability, for OpenCL™ 1.2 device programs. SPIR (Standard Portable Intermediate Representation) is the industry's first open, cross-platform Intermediate Representation standard for portable heterogeneous parallel computing and is based on LLVM IR. SPIR enables developers to avoid exposing sensitive kernel source and enables a diversity of language front-ends to easily target OpenCL platforms and devices in addition to OpenCL C. The SPIR specification and registry can be found at http://www.khronos.org/registry/spir.

Before the development of SPIR, new tools and languages for accessing parallel acceleration on heterogeneous systems required specific and detailed knowledge to create compiler back-ends for each vendor's unique hardware architecture. The SPIR standard enables vendors to accept and accelerate SPIR binaries on their hardware, freeing higher-level languages to innovate across a diverse range of platforms including discrete accelerator boards, system on chips, graphics processors and FPGAs.

SPIR enables a rich ecosystem of compiler middleware for portable parallel programs by building on the strengths of LLVM and OpenCL. SPIR is a specialization of LLVM 3.2 IR, but also encodes OpenCL-specific semantics. The cl_khr_spir standard extension to OpenCL 1.2 and 2.0 defines how to load a SPIR instance into an OpenCL runtime. The development of SPIR has been validated on multiple vendor implementations of OpenCL, and has benefited from a thorough open consultation process between Khronos and the LLVM and Clang communities.

In addition to the SPIR specification, Khronos is making the following open source software components available on Github under the same license as LLVM and Clang:

  • a modified Clang 3.2 which generates SPIR from device programs in OpenCL C version 1.2;
  • a SPIR module verifier, written in the form of an LLVM pass;
  • a header file containing definitions for all enumerated values in the SPIR 1.2 specification.



Further details on these resources can be found at: https://github.com/KhronosGroup.

With the release of SPIR 1.2 and associated software tools, the Khronos Group welcomes developers of diverse computing and graphics stacks to leverage SPIR for cross vendor portability and to drive innovation on the following fronts:


  • Front-ends: new language front-ends and programming abstractions for heterogeneous parallel programming can target production quality OpenCL backends through SPIR;
  • Back-ends: new target platforms based on multicore, vector, VLIW or other technologies can reuse production quality language frontends and abstractions;
  • Tooling: advanced program analysis and optimization of programs in SPIR form.

For example, the developers of both OpenACC and C++ AMP have stated that they will target SPIR to access optimized back-ends across multiple vendors.

Industry Support

"AMD (News - Alert) is very excited to see the Khronos Group finalize its SPIR 1.2 specification to build on the industry momentum driving heterogeneous computing, and we expect SPIR 1.2 to help enable a broad set of programming languages that take advantage of the immense computing capabilities of graphics hardware," said Gregory Stoner, senior director, HSA Application Engineering, AMD, and Managing Director of the HSA Foundation. "SPIR 1.2 addresses several new features requested by our developers, including the ability to ship OpenCL kernels in a binary representation."

"I expect SPIR to open up many new areas of research in heterogeneous parallel systems," said Simon McIntosh-Smith, Head of the Microelectronics Research Group at the University of Bristol. "A portable intermediate representation such as this will enable the development of exciting new software tools and parallel languages, and will thus accelerate the adoption of next generation parallel architectures."

"SPIR will be a key enabler for innovation in heterogeneous computing. Before SPIR, producing a new tool or language for accelerating on today's spectacularly powerful and efficient heterogeneous systems would require in-depth knowledge and access to each different hardware vendor's architecture," said Andrew Richards, CEO of Codeplay. "Now, with SPIR as an open, cross-platform standard, we can innovate across a whole range of hardware architectures. This heralds in a new era of heterogeneous computing and I commend the excellent work by the group putting this cross-vendor standard together."

"We are excited to see SPIR publicly released and believe it will greatly help OpenCL adoption by making application deployment more convenient and portable across hardware platforms," said Jonathan Khazam, vice president and general manager of Intel's (News - Alert) Visual & Parallel Computing Group. "SPIR and OpenCL are a great way to take advantage of GPU computing to deliver new experiences on a wide range of computing devices, from phones and tablets to PCs."

About The Khronos Group

The Khronos Group is an industry consortium creating open standards to enable the authoring and acceleration of parallel computing, graphics, vision, sensor processing and dynamic media on a wide variety of platforms and devices. Khronos standards include OpenGL®, OpenGL® ES, WebGL™, OpenCL™, WebCL™, OpenVX™, OpenMAX™, OpenVG™, OpenSL ES™, StreamInput™ and COLLADA™. All Khronos members are enabled to contribute to the development of Khronos specifications, are empowered to vote at various stages before public deployment, and are able to accelerate the delivery of their cutting-edge media platforms and applications through early access to specification drafts and conformance tests. More information is available at www.khronos.org.

Khronos, DevU, StreamInput, WebGL, WebCL, COLLADA, OpenKODE, OpenVG, OpenVX, OpenSL ES, OpenMAX, glTF and SPIR are trademarks of the Khronos Group Inc. ASTC is a trademark of ARM (News - Alert) Holdings PLC, OpenCL is a trademark of Apple Inc. and OpenGL is a registered trademark and the OpenGL ES and OpenGL SC logos are trademarks of Silicon Graphics International used under license by Khronos. All other product names, trademarks, and/or company names are used solely for identification and belong to their respective owners.


[ Back To TMCnet.com's Homepage ]