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_errors.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 
28 #include "ccl_errors.h"
29 
30 static const char* ccl_errors[] = {
31  "Successful operation", /* CL_SUCCESS - 0 */
32  "Device not found", /* CL_DEVICE_NOT_FOUND - 1 */
33  "Device not available", /* CL_DEVICE_NOT_AVAILABLE - 2 */
34  "Compiler not available", /* CL_COMPILER_NOT_AVAILABLE - 3 */
35  "Memory object allocation failure", /* CL_MEM_OBJECT_ALLOCATION_FAILURE - 4 */
36  "Out of resources", /* CL_OUT_OF_RESOURCES - 5 */
37  "Out of host memory", /* CL_OUT_OF_HOST_MEMORY - 6 */
38  "Profiling info not available", /* CL_PROFILING_INFO_NOT_AVAILABLE - 7 */
39  "Memory copy overlap", /* CL_MEM_COPY_OVERLAP - 8 */
40  "Image format mismatch", /* CL_IMAGE_FORMAT_MISMATCH - 9 */
41  "Image format not supported", /* CL_IMAGE_FORMAT_NOT_SUPPORTED - 10 */
42  "Build program failure", /* CL_BUILD_PROGRAM_FAILURE - 11 */
43  "Map failure", /* CL_MAP_FAILURE - 12 */
44  "Misaligned sub-buffer offset", /* CL_MISALIGNED_SUB_BUFFER_OFFSET - 13 */
45  "Execution status error for events in wait list", /* CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST - 14 */
46  "Compile program failure", /* CL_COMPILE_PROGRAM_FAILURE - 15 */
47  "Linker not available", /* CL_LINKER_NOT_AVAILABLE - 16 */
48  "Link program failure", /* CL_LINK_PROGRAM_FAILURE - 17 */
49  "Device partition failed", /* CL_DEVICE_PARTITION_FAILED - 18 */
50  "Argument information not available", /* CL_KERNEL_ARG_INFO_NOT_AVAILABLE - 19 */
51  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 20 */
52  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 21 */
53  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 22 */
54  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 23 */
55  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 24 */
56  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 25 */
57  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 26 */
58  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 27 */
59  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 28 */
60  "Unassigned error code", /* Unassigned as of OpenCL 2.1 - 29 */
61  "Invalid value", /* CL_INVALID_VALUE - 30 */
62  "Invalid device type", /* CL_INVALID_DEVICE_TYPE - 31 */
63  "Invalid platform", /* CL_INVALID_PLATFORM - 32 */
64  "Invalid device", /* CL_INVALID_DEVICE - 33 */
65  "Invalid context", /* CL_INVALID_CONTEXT - 34 */
66  "Invalid queue properties", /* CL_INVALID_QUEUE_PROPERTIES - 35 */
67  "Invalid command queue", /* CL_INVALID_COMMAND_QUEUE - 36 */
68  "Invalid host pointer", /* CL_INVALID_HOST_PTR - 37 */
69  "Invalid memory object", /* CL_INVALID_MEM_OBJECT - 38 */
70  "Invalid image format descriptor", /* CL_INVALID_IMAGE_FORMAT_DESCRIPTOR - 39 */
71  "Invalid image size", /* CL_INVALID_IMAGE_SIZE - 40 */
72  "Invalid sampler", /* CL_INVALID_SAMPLER - 41 */
73  "Invalid binary", /* CL_INVALID_BINARY - 42 */
74  "Invalid build options", /* CL_INVALID_BUILD_OPTIONS - 43 */
75  "Invalid program", /* CL_INVALID_PROGRAM - 44 */
76  "Invalid program executable", /* CL_INVALID_PROGRAM_EXECUTABLE - 45 */
77  "Invalid kernel name", /* CL_INVALID_KERNEL_NAME - 46 */
78  "Invalid kernel definition", /* CL_INVALID_KERNEL_DEFINITION - 47 */
79  "Invalid kernel", /* CL_INVALID_KERNEL - 48 */
80  "Invalid argument index", /* CL_INVALID_ARG_INDEX - 49 */
81  "Invalid argument value", /* CL_INVALID_ARG_VALUE - 50 */
82  "Invalid argument size", /* CL_INVALID_ARG_SIZE - 51 */
83  "Invalid kernel arguments", /* CL_INVALID_CCL_KERNEL_ARGS - 52 */
84  "Invalid work dimension", /* CL_INVALID_WORK_DIMENSION - 53 */
85  "Invalid work-group size", /* CL_INVALID_WORK_GROUP_SIZE - 54 */
86  "Invalid work-item size", /* CL_INVALID_WORK_ITEM_SIZE - 55 */
87  "Invalid global offset", /* CL_INVALID_GLOBAL_OFFSET - 56 */
88  "Invalid event wait list", /* CL_INVALID_EVENT_WAIT_LIST - 57 */
89  "Invalid event", /* CL_INVALID_EVENT - 58 */
90  "Invalid operation", /* CL_INVALID_OPERATION - 59 */
91  "Invalid GL object", /* CL_INVALID_GL_OBJECT - 60 */
92  "Invalid buffer size", /* CL_INVALID_BUFFER_SIZE - 61 */
93  "Invalid MIP level", /* CL_INVALID_MIP_LEVEL - 62 */
94  "Invalid global work size", /* CL_INVALID_GLOBAL_WORK_SIZE - 63 */
95  "Invalid property", /* CL_INVALID_PROPERTY - 64 */
96  "Invalid image descriptor", /* CL_INVALID_IMAGE_DESCRIPTOR - 65 */
97  "Invalid compiler options", /* CL_INVALID_COMPILER_OPTIONS - 66 */
98  "Invalid linker options", /* CL_INVALID_LINKER_OPTIONS - 67 */
99  "Invalid device partition count", /* CL_INVALID_DEVICE_PARTITION_COUNT - 68 */
100  "Invalid pipe size", /* CL_INVALID_PIPE_SIZE - 69 */
101  "Invalid device queue" /* CL_INVALID_DEVICE_QUEUE - 70 */
102 };
103 
104 static const int ccl_errors_count = 71;
105 
117 CCL_EXPORT
118 const char* ccl_err(int code) {
119  int index = -1 * code;
120  return (index >= 0) && (index < ccl_errors_count)
121  ? ccl_errors[index]
122  : "Unknown OpenCL error code";
123 }
124 
const char * ccl_err(int code)
Convert OpenCL error code to a readable string.
Definition: ccl_errors.c:118
Convert OpenCL error codes to readable strings (function header).