cf4ocl (C Framework for OpenCL)  v2.1.0
Object-oriented framework for developing and benchmarking OpenCL projects in C/C++
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ccl_wrapper Struct Reference

Base class for all OpenCL wrappers. More...

Inheritance diagram for ccl_wrapper:
Inheritance graph
Collaboration diagram for ccl_wrapper:
Collaboration graph

Public Member Functions

CCLWrapperInfoccl_wrapper_get_info (CCLWrapper *wrapper1, CCLWrapper *wrapper2, cl_uint param_name, size_t min_size, CCLInfo info_type, cl_bool use_cache, CCLErr **err)
 Get information about any wrapped OpenCL object. More...
 
size_t ccl_wrapper_get_info_size (CCLWrapper *wrapper1, CCLWrapper *wrapper2, cl_uint param_name, size_t min_size, CCLInfo info_type, cl_bool use_cache, CCLErr **err)
 Get information size. More...
 
void * ccl_wrapper_get_info_value (CCLWrapper *wrapper1, CCLWrapper *wrapper2, cl_uint param_name, size_t min_size, CCLInfo info_type, cl_bool use_cache, CCLErr **err)
 Get pointer to information value. More...
 
cl_bool ccl_wrapper_memcheck ()
 Debug function which checks if memory allocated by wrappers has been properly freed. More...
 
void ccl_wrapper_ref (CCLWrapper *wrapper)
 Increase the reference count of the wrapper object. More...
 
int ccl_wrapper_ref_count (CCLWrapper *wrapper)
 Returns the wrapper object reference count. More...
 
void * ccl_wrapper_unwrap (CCLWrapper *wrapper)
 Get the wrapped OpenCL object. More...
 

Detailed Description

Base class for all OpenCL wrappers.

Definition at line 47 of file _ccl_abstract_wrapper.h.

Member Function Documentation

CCLWrapperInfo * ccl_wrapper_get_info ( CCLWrapper wrapper1,
CCLWrapper wrapper2,
cl_uint  param_name,
size_t  min_size,
CCLInfo  info_type,
cl_bool  use_cache,
CCLErr **  err 
)

Get information about any wrapped OpenCL object.

This function should not be directly invoked in most circumstances. Use the ccl_*_get_info_*() macros instead.

Parameters
[in]wrapper1The wrapper object to query.
[in]wrapper2A second wrapper object, required in some queries.
[in]param_nameName of information/parameter to get.
[in]min_sizeMinimum size of returned information object in case of error.
[in]info_typeType of information query to perform.
[in]use_cacheTRUE if cached information is to be used, FALSE to force a new query even if information is in cache.
[out]errReturn location for a CCLErr object, or NULL if error reporting is to be ignored.
Returns
The requested information object. This object will be automatically freed when the respective wrapper object is destroyed. If an error occurs, either NULL (if min_size == 0), or a min_sized information object is returned (if min_size > 0).

Definition at line 463 of file ccl_abstract_wrapper.c.

size_t ccl_wrapper_get_info_size ( CCLWrapper wrapper1,
CCLWrapper wrapper2,
cl_uint  param_name,
size_t  min_size,
CCLInfo  info_type,
cl_bool  use_cache,
CCLErr **  err 
)

Get information size.

This function should not be directly invoked in most circumstances.

Parameters
[in]wrapper1The wrapper object to query.
[in]wrapper2A second wrapper object, required in some queries.
[in]param_nameName of information/parameter to get value of.
[in]min_sizeMinimum size returned in case of error.
[in]info_typeType of information query to perform.
[in]use_cacheTRUE if cached information is to be used, FALSE to force a new query even if information is in cache.
[out]errReturn location for a CCLErr object, or NULL if error reporting is to be ignored.
Returns
The requested information size. If an error occurs, a size of min_size is returned.

Definition at line 641 of file ccl_abstract_wrapper.c.

void * ccl_wrapper_get_info_value ( CCLWrapper wrapper1,
CCLWrapper wrapper2,
cl_uint  param_name,
size_t  min_size,
CCLInfo  info_type,
cl_bool  use_cache,
CCLErr **  err 
)

Get pointer to information value.

This function should not be directly invoked in most circumstances. Use the ccl_*_get_info_*() macros instead.

Parameters
[in]wrapper1The wrapper object to query.
[in]wrapper2A second wrapper object, required in some queries.
[in]param_nameName of information/parameter to get value of.
[in]min_sizeMinimum size of returned value in case of error.
[in]info_typeType of information query to perform.
[in]use_cacheTRUE if cached information is to be used, FALSE to force a new query even if information is in cache.
[out]errReturn location for a CCLErr object, or NULL if error reporting is to be ignored.
Returns
A pointer to the requested information value. This value will be automatically freed when the wrapper object is destroyed. If an error occurs, either NULL (if min_size == 0), or a pointer to a min_sized zero value is returned (if min_size > 0).

Definition at line 600 of file ccl_abstract_wrapper.c.

cl_bool ccl_wrapper_memcheck ( )

Debug function which checks if memory allocated by wrappers has been properly freed.

This function is merely a debug helper and shouldn't replace proper leak checks with Valgrind or similar tool.

Returns
CL_TRUE if memory allocated by wrappers has been properly freed, CL_FALSE otherwise.
Examples:
ca.c, canon.c, device_filter.c, image_fill.c, image_filter.c, and list_devices.c.

Definition at line 675 of file ccl_abstract_wrapper.c.

void ccl_wrapper_ref ( CCLWrapper wrapper)

Increase the reference count of the wrapper object.

Parameters
[in]wrapperThe wrapper object.

Definition at line 382 of file ccl_abstract_wrapper.c.

int ccl_wrapper_ref_count ( CCLWrapper wrapper)

Returns the wrapper object reference count.

For debugging and testing purposes only.

Parameters
[in]wrapperThe wrapper object.
Returns
The wrapper object reference count or -1 if wrapper is NULL.

Definition at line 410 of file ccl_abstract_wrapper.c.

void * ccl_wrapper_unwrap ( CCLWrapper wrapper)

Get the wrapped OpenCL object.

Parameters
[in]wrapperThe wrapper object.
Returns
The wrapped OpenCL object.

Definition at line 429 of file ccl_abstract_wrapper.c.