29 #ifndef _CCL_PROGRAM_WRAPPER_H_
30 #define _CCL_PROGRAM_WRAPPER_H_
207 cl_program program,
void* user_data);
229 const char* filename,
CCLErr** err);
234 cl_uint count,
const char** filenames,
CCLErr** err);
240 const char*
string,
CCLErr** err);
246 cl_uint count,
const char** strings,
const size_t* lengths,
257 CCLDevice* dev,
const char* filename, cl_int *binary_status,
264 cl_uint num_devices,
CCLDevice*
const* devs,
const char** filenames,
265 cl_int *binary_status,
CCLErr** err);
279 cl_int *binary_status,
CCLErr** err);
288 cl_uint num_devices,
CCLDevice*
const* devs,
const char *kernel_names,
306 cl_uint num_devices,
CCLDevice*
const* devs,
const char* options,
323 CCLDevice*
const* devs,
const char* options, cl_uint num_input_headers,
324 CCLProgram** prg_input_headers,
const char** header_include_names,
330 CCLDevice*
const* devs,
const char* options, cl_uint num_input_programs,
332 void* user_data,
CCLErr** err);
356 const char* kernel_name,
CCLQueue* cq, cl_uint work_dim,
357 const size_t* global_work_offset,
const size_t* global_work_size,
359 CCLErr** err, ...) G_GNUC_NULL_TERMINATED;
364 const
char* kernel_name,
CCLQueue* cq, cl_uint work_dim,
365 const
size_t* global_work_offset, const
size_t* global_work_size,
367 void** args,
CCLErr** err);
381 const
char* filename,
CCLErr** err);
387 const
char* file_prefix, const
char* file_suffix,
char*** filenames,
427 #define ccl_program_get_info(prg, param_name, err) \
428 (param_name == CL_PROGRAM_BINARIES) \
430 : ccl_wrapper_get_info((CCLWrapper*) prg, NULL, param_name, 0, \
431 CCL_INFO_PROGRAM, CL_FALSE, err)
450 #define ccl_program_get_info_scalar(prg, param_name, param_type, err) \
451 (param_name == CL_PROGRAM_BINARIES) \
453 : *((param_type*) ccl_wrapper_get_info_value((CCLWrapper*) prg, \
454 NULL, param_name, sizeof(param_type), \
455 CCL_INFO_PROGRAM, CL_FALSE, err))
477 #define ccl_program_get_info_array(prg, param_name, param_type, err) \
478 (param_name == CL_PROGRAM_BINARIES) \
480 : (param_type) ccl_wrapper_get_info_value((CCLWrapper*) prg, \
481 NULL, param_name, sizeof(param_type), \
482 CCL_INFO_PROGRAM, CL_FALSE, err)
496 #define ccl_program_get_build_info(prg, dev, param_name, err) \
497 ccl_wrapper_get_info((CCLWrapper*) prg, (CCLWrapper*) dev, \
498 param_name, 0, CCL_INFO_PROGRAM_BUILD, CL_FALSE, err)
517 #define ccl_program_get_build_info_scalar(prg, dev, param_name, \
519 *((param_type*) ccl_wrapper_get_info_value((CCLWrapper*) prg, \
520 (CCLWrapper*) dev, param_name, sizeof(param_type), \
521 CCL_INFO_PROGRAM_BUILD, CL_FALSE, err))
540 #define ccl_program_get_build_info_array(prg, dev, param_name, \
542 (param_type) ccl_wrapper_get_info_value((CCLWrapper*) prg, \
543 (CCLWrapper*) dev, param_name, sizeof(param_type), \
544 CCL_INFO_PROGRAM_BUILD, CL_FALSE, err)
551 #define ccl_program_ref(prg) \
552 ccl_wrapper_ref((CCLWrapper*) prg)
560 #define ccl_program_unref(prg) ccl_program_destroy(prg)
568 #define ccl_program_unwrap(prg) \
569 ((cl_program) ccl_wrapper_unwrap((CCLWrapper*) prg))
const char * ccl_program_get_device_build_log(CCLProgram *prg, CCLDevice *dev, CCLErr **err)
Get build log for most recent build, compile or link for the specified device.
Definition of a wrapper class and its methods for OpenCL kernel objects.
CCLDevice *const * ccl_program_get_all_devices(CCLProgram *prg, CCLErr **err)
Get all device wrappers in program.
CCLEvent * ccl_program_enqueue_kernel(CCLProgram *prg, const char *kernel_name, CCLQueue *cq, cl_uint work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, CCLEventWaitList *evt_wait_lst, CCLErr **err,...)
Enqueues a program kernel function for execution on a device.
CCLEvent * ccl_program_enqueue_kernel_v(CCLProgram *prg, const char *kernel_name, CCLQueue *cq, cl_uint work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, CCLEventWaitList *evt_wait_lst, void **args, CCLErr **err)
Enqueues a program kernel function for execution on a device.
GPtrArray * CCLEventWaitList
A list of event objects on which enqueued commands can wait.
CCLProgram * ccl_program_new_from_binary_file(CCLContext *ctx, CCLDevice *dev, const char *filename, cl_int *binary_status, CCLErr **err)
Create a new program wrapper object from a file containing binary code executable on a specific devic...
CCLProgram * ccl_program_new_from_built_in_kernels(CCLContext *ctx, cl_uint num_devices, CCLDevice *const *devs, const char *kernel_names, CCLErr **err)
Create a new program wrapper object from device built-in kernels.
Definition of a wrapper class and its methods for OpenCL context objects.
Definition of a wrapper class and its methods for OpenCL event objects.
The context wrapper class.
CCLProgram * ccl_program_new_from_source(CCLContext *ctx, const char *string, CCLErr **err)
Create a new program wrapper object from a null-terminated source string.
Command queue wrapper class.
cl_uint ccl_program_get_opencl_version(CCLProgram *prg, CCLErr **err)
Get the OpenCL version of the platform associated with this program.
CCLProgram * ccl_program_new_wrap(cl_program program)
Get the program wrapper for the given OpenCL program.
CCLProgramBinary * ccl_program_get_binary(CCLProgram *prg, CCLDevice *dev, CCLErr **err)
Get the program binary object for the specified device.
CCLProgram * ccl_program_new_from_binaries(CCLContext *ctx, cl_uint num_devices, CCLDevice *const *devs, CCLProgramBinary **bins, cl_int *binary_status, CCLErr **err)
Create a new program wrapper object from a list of binary code strings executable on the given device...
cl_bool ccl_program_build(CCLProgram *prg, const char *options, CCLErr **err)
Utility function which builds (compiles and links) a program executable from the program source or bi...
cl_bool ccl_program_save_all_binaries(CCLProgram *prg, const char *file_prefix, const char *file_suffix, char ***filenames, CCLErr **err)
Save the program binaries for all associated devices to files, one file per device.
const char * ccl_program_get_build_log(CCLProgram *prg, CCLErr **err)
Get a general build log of most recent build, compile or link, for all devices.
CCLProgram * ccl_program_new_from_source_file(CCLContext *ctx, const char *filename, CCLErr **err)
Create a new program wrapper object from a source file.
CCLProgram * ccl_program_link(CCLContext *ctx, cl_uint num_devices, CCLDevice *const *devs, const char *options, cl_uint num_input_programs, CCLProgram **input_prgs, ccl_program_callback pfn_notify, void *user_data, CCLErr **err)
Link a set of compiled programs and create an executable program wrapper.
Definition of an abstract wrapper class and its methods for OpenCL objects.
CCLProgram * ccl_program_new_from_binary(CCLContext *ctx, CCLDevice *dev, CCLProgramBinary *binary, cl_int *binary_status, CCLErr **err)
Create a new program wrapper object from binary code executable on a specific device.
CCLProgram * ccl_program_new_from_source_files(CCLContext *ctx, cl_uint count, const char **filenames, CCLErr **err)
Create a new program wrapper object from several source files.
Header for normalizing OpenCL versions within cf4ocl.
void(* ccl_program_callback)(cl_program program, void *user_data)
Prototype of callback functions for program build, compile and link.
CCLProgram * ccl_program_new_from_binary_files(CCLContext *ctx, cl_uint num_devices, CCLDevice *const *devs, const char **filenames, cl_int *binary_status, CCLErr **err)
Create a new program wrapper object from files containing binary code executable on the given device ...
cl_bool ccl_program_compile(CCLProgram *prg, cl_uint num_devices, CCLDevice *const *devs, const char *options, cl_uint num_input_headers, CCLProgram **prg_input_headers, const char **header_include_names, ccl_program_callback pfn_notify, void *user_data, CCLErr **err)
Compile a program's source code.
GError CCLErr
Error handling class.
cl_bool ccl_program_save_binary(CCLProgram *prg, CCLDevice *dev, const char *filename, CCLErr **err)
Save the program binary code for a specified device to a file.
CCLDevice * ccl_program_get_device(CCLProgram *prg, cl_uint index, CCLErr **err)
Get CCLDevice wrapper at given index.
CCLKernel * ccl_program_get_kernel(CCLProgram *prg, const char *kernel_name, CCLErr **err)
Get the kernel wrapper object for the given program kernel function.
Definition of a wrapper class and its methods for OpenCL queue objects.
cl_bool ccl_program_build_full(CCLProgram *prg, cl_uint num_devices, CCLDevice *const *devs, const char *options, ccl_program_callback pfn_notify, void *user_data, CCLErr **err)
Builds (compiles and links) a program executable from the program source or binary.
void ccl_program_destroy(CCLProgram *prg)
Decrements the reference count of the program wrapper object.
Class which represents a binary object associated with a program and a device.
CCLProgram * ccl_program_new_from_sources(CCLContext *ctx, cl_uint count, const char **strings, const size_t *lengths, CCLErr **err)
Create a new program wrapper object from several source code strings.
cl_uint ccl_program_get_num_devices(CCLProgram *prg, CCLErr **err)
Return number of devices in program.