Extension adds support to create an OpenCL program object from a Standard Portable Intermediate Representation (SPIR) instance.

#pragma OPENCL EXTENSION cl_khr_spir : enable


Additions to section 5.8.1 –Creating Program Objects:

This extension adds the device property CL_DEVICE_SPIR_VERSIONS to Table 4.3 (see clGetDeviceInfo).

Additions to section 5.8.1 –Creating Program Objects:

clCreateProgramWithBinary can be used to load a SPIR binary. Once a program object has been created from a SPIR binary, clBuildProgram can be called to build a program executable or clCompileProgram can be called to compile the SPIR binary.

Modify the CL_PROGRAM_BINARY_TYPE entry in table 5.14 (see clGetProgramBuildInfo) to add a potential value CL_PROGRAM_BINARY_TYPE_INTERMEDIATE.

Additions to section 5.8.4 –Compiler Options.:

The compile option -x spir must be specified to indicate that the binary is in SPIR format, and the compile option -spir-std must be used to specify the version of the SPIR specification that describes the format and meaning of the binary. For example, if the binary is as described in SPIR version 1.2, then -spir-std=1.2 must be specified. Failing to specify these compile options may result in implementation defined behavior.


OpenCL Specification

Also see

EXTENSION, clCreateProgramWithBinary, clBuildProgram, clCompileProgram, clGetDeviceInfo

Copyright © 2007-2013 The Khronos Group Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.