Function pocky_opencl_kernels_from_fragments

Function Documentation

cl_int pocky_opencl_kernels_from_fragments(cl_uint nfrags, const char **frags, cl_context ctx, cl_program *prog, cl_uint *num_kerns, cl_kernel **kerns)

Creates and builds all kernels in the given array of fragments for the given context. If errors occur during the build step, the build logs for the failed builds are written to stderr.

Important

The user is responsible for checking the return code before using the program in prog or the kernels in kerns, since any of these handles may not valid if building failed.

Parameters:
  • nfrags[in] Number of input source fragments in frags

  • frags[in] Array of fragments to compile and link

  • ctx[in] Context for which to build all kernels

  • prog[out] Program encapsulating the kernels

  • num_kerns[out] Number of compiled and built kernels

  • kerns[out] Array of compiled and built kernels

Returns:

On success, CL_SUCCESS, otherwise an OpenCL error code