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_kernel_arg.h
Go to the documentation of this file.
1 /*
2  * This file is part of cf4ocl (C Framework for OpenCL).
3  *
4  * cf4ocl is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, either version 3 of the
7  * License, or (at your option) any later version.
8  *
9  * cf4ocl is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with cf4ocl. If not, see
16  * <http://www.gnu.org/licenses/>.
17  * */
18 
30 #ifndef _CCL_KERNEL_ARG_H_
31 #define _CCL_KERNEL_ARG_H_
32 
33 #include "ccl_common.h"
34 #include "ccl_abstract_wrapper.h"
35 
45 
46 /* Create a new kernel argument. */
47 CCL_EXPORT
48 CCLArg* ccl_arg_new(void* value, size_t size);
49 
50 /* Destroy a kernel argument. */
51 CCL_EXPORT
52 void ccl_arg_destroy(CCLArg* arg);
53 
54 /* Get size in bytes of kernel argument. */
55 CCL_EXPORT
56 size_t ccl_arg_size(CCLArg* arg);
57 
58 /* Get value of kernel argument. */
59 CCL_EXPORT
60 void* ccl_arg_value(CCLArg* arg);
61 
126 CCL_EXPORT
127 extern const CCLArg* ccl_arg_skip;
128 
141 #define ccl_arg_priv(value, type) \
142  ccl_arg_new(&value, sizeof(type))
143 
156 #define ccl_arg_local(count, type) \
157  ccl_arg_new(NULL, count * sizeof(type))
158 
170 #define ccl_arg_full(value, size) \
171  ccl_arg_new(value, size)
172 
175 #endif
CCLArg * ccl_arg_new(void *value, size_t size)
Create a new kernel argument.
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.
CCLWrapper CCLArg
The CCLArg type is an alias for CCLWrapper type.
Base class for all OpenCL wrappers.
Definition of an abstract wrapper class and its methods for OpenCL objects.
Common cf4ocl definitions.