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_common.c
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 
29 #include "ccl_common.h"
30 
36 CCL_EXPORT
37 void ccl_common_version_print(const char* exec_name) {
38  g_printf("%s %s - Compiled with %s C Compiler with support for OpenCL %s\n"
39  "Copyright (C) 2016 Nuno Fachada\n"
40  "License GPLv3+: GNU GPL version 3 or later "
41  "<http://gnu.org/licenses/gpl.html>.\n"
42  "This is free software: you are free to change and redistribute it.\n"
43  "There is NO WARRANTY, to the extent permitted by law.\n\n"
44  "Written by Nuno Fachada\n",
46 }
47 
56 CCL_EXPORT
57 void ccl_strv_clear(char** str_array) {
58  g_strfreev(str_array);
59 }
60 
72 CCL_EXPORT
73 void ccl_err_clear(CCLErr** err) {
74  g_clear_error(err);
75 }
76 
84 CCL_EXPORT
85 GQuark ccl_error_quark() {
86  return g_quark_from_static_string("ccl-error-quark");
87 }
88 
96 CCL_EXPORT
98  return g_quark_from_static_string("ccl-ocl-error-quark");
99 }
GQuark ccl_ocl_error_quark()
Resolves to error category identifying string, in this case an error in the OpenCL library...
Definition: ccl_common.c:97
GQuark ccl_error_quark()
Resolves to error category identifying string, in this case an error in cf4ocl.
Definition: ccl_common.c:85
#define CCL_OPENCL_VERSION
Version of OpenCL headers used to compile cf4ocl.
Definition: ccl_common.h:69
void ccl_common_version_print(const char *exec_name)
Print executable version.
Definition: ccl_common.c:37
#define CCL_VERSION_STRING_FINAL
Final cf4ocl version string, either CCL_VERSION_STRING for stable versions or cf4ocl2_VERSION_STRING_...
Definition: ccl_common.h:59
void ccl_strv_clear(char **str_array)
Frees a NULL-terminated array of strings, as well as each string it contains.
Definition: ccl_common.c:57
GError CCLErr
Error handling class.
Definition: ccl_common.h:291
void ccl_err_clear(CCLErr **err)
Releases a CCLErr object and set is to NULL.
Definition: ccl_common.c:73
Common cf4ocl definitions.
#define CCL_COMPILER
Compiler used to compile cf4ocl.
Definition: ccl_common.h:83