cl_helper.h
Go to the documentation of this file.
1 
28 #ifndef CL_HELPER_H
29 #define CL_HELPER_H
30 
31 namespace lvr2
32 {
33 
34 static const char* errorString[] = {
35  "CL_SUCCESS",
36  "CL_DEVICE_NOT_FOUND",
37  "CL_DEVICE_NOT_AVAILABLE",
38  "CL_COMPILER_NOT_AVAILABLE",
39  "CL_MEM_OBJECT_ALLOCATION_FAILURE",
40  "CL_OUT_OF_RESOURCES",
41  "CL_OUT_OF_HOST_MEMORY",
42  "CL_PROFILING_INFO_NOT_AVAILABLE",
43  "CL_MEM_COPY_OVERLAP",
44  "CL_IMAGE_FORMAT_MISMATCH",
45  "CL_IMAGE_FORMAT_NOT_SUPPORTED",
46  "CL_BUILD_PROGRAM_FAILURE",
47  "CL_MAP_FAILURE",
48  "",
49  "",
50  "",
51  "",
52  "",
53  "",
54  "",
55  "",
56  "",
57  "",
58  "",
59  "",
60  "",
61  "",
62  "",
63  "",
64  "",
65  "CL_INVALID_VALUE",
66  "CL_INVALID_DEVICE_TYPE",
67  "CL_INVALID_PLATFORM",
68  "CL_INVALID_DEVICE",
69  "CL_INVALID_CONTEXT",
70  "CL_INVALID_QUEUE_PROPERTIES",
71  "CL_INVALID_COMMAND_QUEUE",
72  "CL_INVALID_HOST_PTR",
73  "CL_INVALID_MEM_OBJECT",
74  "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR",
75  "CL_INVALID_IMAGE_SIZE",
76  "CL_INVALID_SAMPLER",
77  "CL_INVALID_BINARY",
78  "CL_INVALID_BUILD_OPTIONS",
79  "CL_INVALID_PROGRAM",
80  "CL_INVALID_PROGRAM_EXECUTABLE",
81  "CL_INVALID_KERNEL_NAME",
82  "CL_INVALID_KERNEL_DEFINITION",
83  "CL_INVALID_KERNEL",
84  "CL_INVALID_ARG_INDEX",
85  "CL_INVALID_ARG_VALUE",
86  "CL_INVALID_ARG_SIZE",
87  "CL_INVALID_KERNEL_ARGS",
88  "CL_INVALID_WORK_DIMENSION",
89  "CL_INVALID_WORK_GROUP_SIZE",
90  "CL_INVALID_WORK_ITEM_SIZE",
91  "CL_INVALID_GLOBAL_OFFSET",
92  "CL_INVALID_EVENT_WAIT_LIST",
93  "CL_INVALID_EVENT",
94  "CL_INVALID_OPERATION",
95  "CL_INVALID_GL_OBJECT",
96  "CL_INVALID_BUFFER_SIZE",
97  "CL_INVALID_MIP_LEVEL",
98  "CL_INVALID_GLOBAL_WORK_SIZE",
99  "CL_INVALID_PROPERTY",
100  "CL_INVALID_IMAGE_DESCRIPTOR",
101  "CL_INVALID_COMPILER_OPTIONS",
102  "CL_INVALID_LINKER_OPTIONS",
103  "CL_INVALID_DEVICE_PARTITION_COUNT",
104 };
105 #define checkOclErrors(err) __checkOclErrors((err), #err, __FILE__, __LINE__)
106 static void __checkOclErrors(const cl_int err, const char* const func, const char* const file, const int line)
107 {
108  if (err != CL_SUCCESS)
109  {
110  fprintf(stderr, "OpenCL error at %s:%d code=%d(%s) \"%s\" \n", file, line, err, -68 <= err && err < 0 ? errorString[-err] : "Unspecified Error", func);
111  }
112 }
113 
114 } // namespace lvr2
115 
116 #endif
lvr2::__checkOclErrors
static void __checkOclErrors(const cl_int err, const char *const func, const char *const file, const int line)
Definition: cl_helper.h:106
lvr2::errorString
static const char * errorString[]
Definition: cl_helper.h:34
file
FILE * file
Definition: arithmeticencoder.cpp:77
lvr2
Definition: BaseBufferManipulators.hpp:39


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23