Creates a program object for a context, and loads the IL into the program object.
cl_program clCreateProgramWithIL(cl_context context,
const void *il,
size_t length,
cl_int *errcode_ret)context-
Must be a valid OpenCL context.
il-
A pointer to a
length-byte block of memory containing SPIR-V or an implementation-defined intermediate language. lengtherrcode_ret-
Returns an appropriate error code. If
errcode_retis NULL, no error code is returned.
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_CONTEXTifcontextis not a valid context. -
CL_INVALID_VALUEifilis NULL orlengthis zero. -
CL_INVALID_VALUEif thelength-byte memory pointed to byildoes not contain well-formed intermediate language input that can be consumed by the OpenCL runtime. -
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device. -
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.