C Specification
To create a program object for a context and load code in an intermediate language into that object, call the function
// Provided by CL_VERSION_2_1
cl_program clCreateProgramWithIL(
cl_context context,
const void* il,
size_t length,
cl_int* errcode_ret);
| clCreateProgramWithIL is missing before version 2.1. |
or the equivalent
// Provided by cl_khr_il_program
cl_program clCreateProgramWithILKHR(
cl_context context,
const void* il,
size_t length,
cl_int* errcode_ret);
clCreateProgramWithILKHR is provided by the cl_khr_il_program extension.
|
Parameters
-
context must be a valid OpenCL context.
-
il is a pointer to a block of memory containing SPIR-V or an implementation-defined intermediate language.
-
length is the length of the block pointed to by il.
-
errcode_ret will return an appropriate error code. If errcode_ret is
NULL, no error code is returned.
Description
The intermediate language pointed to by il and with length in bytes length will be loaded into the program object. The devices associated with the program object are the devices associated with context.
clCreateProgramWithIL returns a valid non-zero program object and
errcode_ret is set to CL_SUCCESS if the program object is created
successfully.
Otherwise, it returns a NULL value with one of the following error values
returned in errcode_ret:
-
CL_INVALID_if context is not a valid context.CONTEXT -
CL_INVALID_if no devices in context support intermediate language programs.OPERATION -
CL_INVALID_if il isVALUE NULLor if length is zero. -
CL_INVALID_if the length-byte block of memory pointed to by il does not contain well-formed intermediate language input that can be consumed by the OpenCL runtime.VALUE -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.