cf4ocl (C Framework for OpenCL)
v2.1.0
Object-oriented framework for developing and benchmarking OpenCL projects in C/C++
|
This module defines the CCLArg* class which wraps kernel arguments. More...
Macros | |
#define | ccl_arg_full(value, size) ccl_arg_new(value, size) |
Defines a kernel argument with more control. More... | |
#define | ccl_arg_full(value, size) ccl_arg_new(value, size) |
Defines a kernel argument with more control. More... | |
#define | ccl_arg_local(count, type) ccl_arg_new(NULL, count * sizeof(type)) |
Defines a local kernel argument, which allocates local memory within the kernel with the specified size. More... | |
#define | ccl_arg_local(count, type) ccl_arg_new(NULL, count * sizeof(type)) |
Defines a local kernel argument, which allocates local memory within the kernel with the specified size. More... | |
#define | ccl_arg_priv(value, type) ccl_arg_new(&value, sizeof(type)) |
Define a private kernel argument. More... | |
#define | ccl_arg_priv(value, type) ccl_arg_new(&value, sizeof(type)) |
Define a private kernel argument. More... | |
Variables | |
const CCLArg * | ccl_arg_skip |
Use this constant to skip kernel arguments in the ccl_kernel_set_args(), ccl_kernel_set_args_v(), ccl_kernel_set_args_and_enqueue_ndrange() and ccl_kernel_set_args_and_enqueue_ndrange_v() functions. | |
const CCLArg * | ccl_arg_skip |
Use this constant to skip kernel arguments in the ccl_kernel_set_args(), ccl_kernel_set_args_v(), ccl_kernel_set_args_and_enqueue_ndrange() and ccl_kernel_set_args_and_enqueue_ndrange_v() functions. | |
This module defines the CCLArg* class which wraps kernel arguments.
Several functions in the kernel wrapper module, such as ccl_kernel_set_args() or ccl_kernel_set_args_and_enqueue_ndrange(), accept kernel arguments as parameters. CCLBuffer*, CCLImage* and CCLSampler* objects can be directly passed as global kernel arguments to these functions. However, local and private kernel arguments need to be passed using the macros provided in this module, namely ccl_arg_local() and ccl_arg_priv(), respectively.
The ccl_arg_skip constant can be passed to methods which accept a variable list of ordered arguments in order to skip a specific argument.
Example:
Kernel code:
Host code:
#define ccl_arg_full | ( | value, | |
size | |||
) | ccl_arg_new(value, size) |
Defines a kernel argument with more control.
The created object is automatically released when kernel is enqueued.
[in] | value | Memory location of argument value. Can be NULL if argument is local. |
[in] | size | Size in bytes of argument. |
Definition at line 170 of file ccl_kernel_arg.h.
#define ccl_arg_full | ( | value, | |
size | |||
) | ccl_arg_new(value, size) |
Defines a kernel argument with more control.
The created object is automatically released when kernel is enqueued.
[in] | value | Memory location of argument value. Can be NULL if argument is local. |
[in] | size | Size in bytes of argument. |
Definition at line 170 of file ccl_kernel_arg.h.
#define ccl_arg_local | ( | count, | |
type | |||
) | ccl_arg_new(NULL, count * sizeof(type)) |
Defines a local kernel argument, which allocates local memory within the kernel with the specified size.
The created object is automatically released when kernel is enqueued.
[in] | count | Number of values of type given in next parameter. |
[in] | type | Argument scalar type, such as cl_int , cl_float , etc. |
Definition at line 156 of file ccl_kernel_arg.h.
#define ccl_arg_local | ( | count, | |
type | |||
) | ccl_arg_new(NULL, count * sizeof(type)) |
Defines a local kernel argument, which allocates local memory within the kernel with the specified size.
The created object is automatically released when kernel is enqueued.
[in] | count | Number of values of type given in next parameter. |
[in] | type | Argument scalar type, such as cl_int , cl_float , etc. |
Definition at line 156 of file ccl_kernel_arg.h.
#define ccl_arg_priv | ( | value, | |
type | |||
) | ccl_arg_new(&value, sizeof(type)) |
Define a private kernel argument.
The created object is automatically released when kernel is enqueued.
[in] | value | Argument value. Must be a variable, not a literal value. |
[in] | type | Argument scalar type, such as cl_int , cl_float , etc. |
Definition at line 141 of file ccl_kernel_arg.h.
#define ccl_arg_priv | ( | value, | |
type | |||
) | ccl_arg_new(&value, sizeof(type)) |
Define a private kernel argument.
The created object is automatically released when kernel is enqueued.
[in] | value | Argument value. Must be a variable, not a literal value. |
[in] | type | Argument scalar type, such as cl_int , cl_float , etc. |
Definition at line 141 of file ccl_kernel_arg.h.