Function pocky_opencl_kernels_from_files

Function Documentation

cl_int pocky_opencl_kernels_from_files(cl_uint nfiles, const char **files, cl_context ctx, cl_program *prog, cl_uint *num_kerns, cl_kernel **kerns)

Creates and builds all kernels in the given array of files 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:
  • nfiles[in] Number of input source files in files

  • files[in] Array of filenames to read, 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