Standard Portable Intermediate Representation

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
SPIR
220px
Original author(s) Khronos Group
Developer(s) Khronos Group
Initial release January 2014 (2014-01)
Operating system Cross-platform
Platform Cross-platform
Type Intermediate language
Website www.khronos.org/spir

Standard Portable Intermediate Representation (SPIR) is an intermediate language for parallel compute and graphics by Khronos Group, originally developed for use with OpenCL. The current version, SPIR-V, was announced in March 2015.

Purpose

OpenCL uses just-in-time compilation (JIT), necessitating one of two software distribution patterns: developers can distribute device-specific pre-compiled binaries, or they can distribute relevant source code, which is limited by the desire to protect intellectual property. SPIR enables the creation and distribution of device-independent binaries within in the OpenCL stack.[1]

Versions

SPIR was originally introduced in 2011, the current version SPIR-V having been introduced in 2015.

  • SPIR 1.2 based on LLVM IR version 3.2; part of OpenCL 1.2 Extension
  • SPIR 2.0 based on LLVM IR version 3.4; part of OpenCL 2.0 Extension
  • SPIR-V not based on LLVM IR; part of OpenCL 2.1 core as well as Vulkan core

LLVM-based versions

SPIR prior to the 2015 SPIR-V release was based on the LLVM Intermediate Representation. A provisional specification for SPIR 1.0 was announced in 2012.[2] Version 1.2 was announced at SIGGRAPH 2013,[3] with version 2.0 following at the same conference a year later.[4]

SPIR-V

SPIR-V is a rewritten version of SPIR announced in March 2015,[5] and released on Nov. 16 2015.[6] The SPIR family now includes a true cross-API standard that is fully defined by Khronos with native support for shader and kernel features.

Support for ingestion of SPIR-V will be incorporated in the core specification of both OpenCL 2.1 and the new Vulkan API for graphics and compute.

SPIR-V is a high-level intermediate language, exchanged in binary form. Functions are represented by a control flow graph of basic blocks, using static single assignment (SSA) form. Data structures retain high-level hierarchical representation. It is not lossy like previous byte-code or virtual machine-like intermediate representations used for graphical shaders. This allows higher performance lowering to target devices.[7]

See also

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.

External links