File indexing completed on 2025-08-03 08:19:07
0001 #include"include/error_msgs.h"
0002
0003 std::string ErrorMessage(int err) {
0004 switch (err) {
0005
0006 case 0: return "CL_SUCCESS The sweet spot. ";
0007
0008 case -1: return "CL_DEVICE_NOT_FOUND clGetDeviceIDs if no OpenCL devices that matched device_type were found. ";
0009
0010 case -2: return "CL_DEVICE_NOT_AVAILABLE clCreateContext if a device in devices is currently not available even though "
0011 "the device was returned by clGetDeviceIDs. ";
0012
0013 case -3: return "CL_COMPILER_NOT _AVAILABLE clBuildProgram if program is created with clCreateProgramWithSource and a "
0014 "compiler is not available i.e. CL_DEVICE_COMPILER_AVAILABLE specified in the table of OpenCL Device Queries for "
0015 "clGetDeviceInfo is set to CL_FALSE. ";
0016
0017 case -4: return "CL_MEM_OBJECT _ALLOCATION_FAILURE if there is a failure to allocate memory for buffer object. ";
0018
0019 case -5: return "CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on "
0020 "the device. ";
0021
0022 case -6: return "CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation "
0023 "on the host. ";
0024
0025 case -7: return "CL_PROFILING_INFO_NOT _AVAILABLE clGetEventProfilingInfo if the CL_QUEUE_PROFILING_ENABLE flag is "
0026 "not set for the command-queue, if the execution status of the command identified by event is "
0027 "not CL_COMPLETE or if event is a user event object. ";
0028
0029 case -8: return "CL_MEM_COPY_OVERLAP clEnqueueCopyBuffer, clEnqueueCopyBufferRect, clEnqueueCopyImage if "
0030 "src_buffer and dst_buffer are the same buffer or subbuffer object and the source and destination regions "
0031 "overlap or if src_buffer and dst_buffer are different sub-buffers of the same associated buffer object and "
0032 "they overlap. The regions overlap if src_offset ≤ to dst_offset ≤ to src_offset + size – "
0033 "1, or if dst_offset ≤ to src_offset ≤ to dst_offset + size – 1. ";
0034
0035 case -9: return "CL_IMAGE_FORMAT _MISMATCH clEnqueueCopyImage if src_image and dst_image do not use the same image "
0036 "format. ";
0037
0038 case -10: return "CL_IMAGE_FORMAT_NOT _SUPPORTED clCreateImage if the image_format is not supported. ";
0039
0040 case -11: return "CL_BUILD_PROGRAM _FAILURE clBuildProgram if there is a failure to build the program executable. This "
0041 "error will be returned if clBuildProgram does not return until the build has completed. ";
0042
0043 case -12: return "CL_MAP_FAILURE clEnqueueMapBuffer, clEnqueueMapImage if there is a failure to map the requested region "
0044 "into the host address space. This error cannot occur for image objects created with CL_MEM_USE_HOST_PTR or "
0045 "CL_MEM_ALLOC_HOST_PTR. ";
0046
0047 case -13: return "CL_MISALIGNED_SUB _BUFFER_OFFSET if a sub-buffer object is specified as the value for an argument that "
0048 "is a buffer object and the offset specified when the sub-buffer object is created is not "
0049 "aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue. ";
0050
0051 case -14: return "CL_EXEC_STATUS_ERROR_ FOR_EVENTS_IN_WAIT_LIST if the execution status of any of the events in "
0052 "event_list is a negative integer value. ";
0053
0054 case -15: return "CL_COMPILE_PROGRAM _FAILURE clCompileProgram if there is a failure to compile the program source. This "
0055 "error will be returned if clCompileProgram does not return until the compile has completed. ";
0056
0057 case -16: return "CL_LINKER_NOT_AVAILABLE clLinkProgram if a linker is not available i.e. CL_DEVICE_LINKER_AVAILABLE "
0058 "specified in the table of allowed values for param_name for clGetDeviceInfo is set to CL_FALSE. ";
0059
0060 case -17: return "CL_LINK_PROGRAM_FAILURE clLinkProgram if there is a failure to link the compiled binaries and/or "
0061 "libraries. ";
0062
0063 case -18: return "CL_DEVICE_PARTITION _FAILED clCreateSubDevices if the partition name is supported by the "
0064 "implementation but in_device could not be further partitioned. ";
0065
0066 case -19: return "CL_KERNEL_ARG_INFO _NOT_AVAILABLE clGetKernelArgInfo if the argument information is not available "
0067 "for kernel. ";
0068
0069 case -30: return "CL_INVALID_VALUE clGetDeviceIDs, clCreateContext This depends on the function: two or more coupled "
0070 "parameters had errors. ";
0071
0072 case -31: return "CL_INVALID_DEVICE_TYPE clGetDeviceIDs if an invalid device_type is given ";
0073
0074 case -32: return "CL_INVALID_PLATFORM clGetDeviceIDs if an invalid platform was given ";
0075
0076 case -33: return "CL_INVALID_DEVICE clCreateContext, clBuildProgram if devices contains an invalid device or are not "
0077 "associated with the specified platform. ";
0078
0079 case -34: return "CL_INVALID_CONTEXT if context is not a valid context. ";
0080
0081 case -35: return "CL_INVALID_QUEUE_PROPERTIES clCreateCommandQueue if specified command-queue-properties are valid "
0082 "but are not supported by the device. ";
0083
0084 case -36: return "CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue. ";
0085
0086 case -37: return "CL_INVALID_HOST_PTR clCreateImage, clCreateBuffer This flag is valid only if host_ptr is not NULL. If "
0087 "specified, it indicates that the application wants the OpenCL implementation to allocate memory for the memory "
0088 "object and copy the data from memory referenced by host_ptr.CL_MEM_COPY_HOST_PTR and CL_MEM_USE_HOST_PTR are "
0089 "mutually exclusive.CL_MEM_COPY_HOST_PTR can be used with CL_MEM_ALLOC_HOST_PTR to initialize the contents of "
0090 "the cl_mem object allocated using host-accessible (e.g. PCIe) memory. ";
0091
0092 case -38: return "CL_INVALID_MEM_OBJECT if memobj is not a valid OpenCL memory object. ";
0093
0094 case -39: return "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR if the OpenGL/DirectX texture internal format does not map to a "
0095 "supported OpenCL image format. ";
0096
0097 case -40: return "CL_INVALID_IMAGE_SIZE if an image object is specified as an argument value and the image dimensions "
0098 "(image width, height, specified or compute row and/or slice pitch) are not supported by device associated "
0099 "with queue. ";
0100
0101 case -41: return "CL_INVALID_SAMPLER clGetSamplerInfo, clReleaseSampler, clRetainSampler, clSetKernelArg if "
0102 "sampler is not a valid sampler object. ";
0103
0104 case -42: return "CL_INVALID_BINARY clCreateProgramWithBinary, clBuildProgram ";
0105
0106 case -43: return "CL_INVALID_BUILD_OPTIONS clBuildProgram if the build options specified by options are invalid. ";
0107
0108 case -44: return "CL_INVALID_PROGRAM if program is a not a valid program object. ";
0109
0110 case -45: return "CL_INVALID_PROGRAM_EXECUTABLE if there is no successfully built program executable available for "
0111 "device associated with command_queue. ";
0112
0113 case -46: return "CL_INVALID_KERNEL_NAME clCreateKernel if kernel_name is not found in program. ";
0114
0115 case -47: return "CL_INVALID_KERNEL_DEFINITION clCreateKernel if the function definition for __kernel function given "
0116 "by kernel_name such as the number of arguments, the argument types are not the same for "
0117 "all devices for which the program executable has been built. ";
0118
0119 case -48: return "CL_INVALID_KERNEL if kernel is not a valid kernel object. ";
0120
0121 case -49: return "CL_INVALID_ARG_INDEX clSetKernelArg, clGetKernelArgInfo if arg_index is not a valid argument index. ";
0122
0123 case -50: return "CL_INVALID_ARG_VALUE clSetKernelArg, clGetKernelArgInfo if arg_value specified is not a valid value. ";
0124
0125 case -51: return "CL_INVALID_ARG_SIZE clSetKernelArg if arg_size does not match the size of the data type for an "
0126 "argument that is not a memory object or if the argument is a memory object and "
0127 "arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local "
0128 "qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler). ";
0129
0130 case -52: return "CL_INVALID_KERNEL_ARGS if the kernel argument values have not been specified. ";
0131
0132 case -53: return "CL_INVALID_WORK_DIMENSION if work_dim is not a valid value (i.e. a value between 1 and 3). ";
0133
0134 case -54: return "CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and number of work-items specified by "
0135 "global_work_size is not evenly divisable by size of work-group given by local_work_size or does not match "
0136 "the work-group size specified for kernel using the __attribute__ ((reqd_work_group_size(X, Y, Z))) "
0137 "qualifier in program source.if local_work_size is specified and the total number of work-items in the work-group "
0138 "computed as local_work_size[0] *… local_work_size[work_dim – 1] is greater than the value specified by "
0139 "CL_DEVICE_MAX_WORK_GROUP_SIZE in the table of OpenCL Device Queries for clGetDeviceInfo.if local_work_size is NULL and the "
0140 "__attribute__ ((reqd_work_group_size(X, Y, Z))) qualifier is used to declare the work-group size for kernel in the "
0141 "program source. ";
0142
0143 case -55: return "CL_INVALID_WORK_ITEM_SIZE if the number of work-items specified in any of local_work_size[0], … "
0144 "local_work_size[work_dim – 1] is greater than the corresponding values specified by CL_DEVICE_MAX_WORK_ITEM_SIZES[0], …. "
0145 "CL_DEVICE_MAX_WORK_ITEM_SIZES[work_dim – 1]. ";
0146
0147 case -56: return "CL_INVALID_GLOBAL_OFFSET if the value specified in global_work_size + the corresponding values in "
0148 "global_work_offset for any dimensions is greater than the sizeof(size_t) for the device on which the kernel "
0149 "execution will be enqueued. ";
0150
0151 case -57: return "CL_INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or "
0152 "event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not "
0153 "valid events. ";
0154
0155 case -58: return "CL_INVALID_EVENT if event objects specified in event_list are not valid event objects. ";
0156
0157 case -59: return "CL_INVALID_OPERATION if interoperability is specified by setting CL_CONTEXT_ADAPTER_D3D9_KHR, "
0158 "CL_CONTEXT_ADAPTER_D3D9EX_KHR or CL_CONTEXT_ADAPTER_DXVA_KHR to a non-NULL value, and interoperability with another graphics API is "
0159 "also specified. (only if the cl_khr_dx9_media_sharing extension is supported). ";
0160
0161 case -60: return "CL_INVALID_GL_OBJECT if texture is not a GL texture object whose type matches texture_target, if the "
0162 "specified miplevel of texture is not defined, or if the width or height of the specified "
0163 "miplevel is zero. ";
0164
0165 case -61: return "CL_INVALID_BUFFER_SIZE clCreateBuffer, clCreateSubBuffer if size is 0.Implementations may return "
0166 "CL_INVALID_BUFFER_SIZE if size is greater than the CL_DEVICE_MAX_MEM_ALLOC_SIZE value specified in the table of allowed values "
0167 "for param_name for clGetDeviceInfo for all devices in context. ";
0168
0169 case -62: return "CL_INVALID_MIP_LEVEL OpenGL-functions if miplevel is greater than zero and the OpenGL implementation "
0170 "does not support creating from non-zero mipmap levels. ";
0171
0172 case -63: return "CL_INVALID_GLOBAL_WORK_SIZE if global_work_size is NULL, or if any of the values specified in "
0173 "global_work_size[0], …global_work_size [work_dim – 1] are 0 or exceed the range given by the sizeof(size_t) for "
0174 "the device on which the kernel execution will be enqueued. ";
0175
0176 case -64: return "CL_INVALID_PROPERTY clCreateContext Vague error, depends on the function ";
0177
0178 case -65: return "CL_INVALID_IMAGE_DESCRIPTOR clCreateImage if values specified in image_desc are not valid or if "
0179 "image_desc is NULL. ";
0180
0181 case -66: return "CL_INVALID_COMPILER_OPTIONS clCompileProgram if the compiler options specified by options are "
0182 "invalid. ";
0183
0184 case -67: return "CL_INVALID_LINKER_OPTIONS clLinkProgram if the linker options specified by options are invalid. ";
0185
0186 case -68: return "CL_INVALID_DEVICE_PARTITION_COUNT clCreateSubDevices if the partition name specified in properties "
0187 "is CL_DEVICE_PARTITION_BY_COUNTS and the number of sub-devices requested exceeds "
0188 "CL_DEVICE_PARTITION_MAX_SUB_DEVICES or the total number of compute units requested exceeds CL_DEVICE_PARTITION_MAX_COMPUTE_UNITS for "
0189 "in_device, or the number of compute units requested for one or more sub-devices is less than "
0190 "zero or the number of sub-devices requested exceeds CL_DEVICE_PARTITION_MAX_COMPUTE_UNITS for in_device. ";
0191
0192 case -69: return "CL_INVALID_PIPE_SIZE clCreatePipe if pipe_packet_size is 0 or the pipe_packet_size exceeds "
0193 "CL_DEVICE_PIPE_MAX_PACKET_SIZE value for all devices in context or if pipe_max_packets is 0. ";
0194
0195 case -70: return "CL_INVALID_DEVICE_QUEUE clSetKernelArg when an argument is of type queue_t when it’s not a valid device "
0196 "queue object. ";
0197
0198 case -1000: return "CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR clGetGLContextInfoKHR, clCreateContext CL and GL not on the "
0199 "same device (only when using a GPU). ";
0200
0201 case -1001: return "CL_PLATFORM_NOT_FOUND_KHR clGetPlatform No valid ICDs found ";
0202
0203 case -1002: return "CL_INVALID_D3D10_DEVICE_KHR clCreateContext, clCreateContextFromType if the Direct3D 10 device "
0204 "specified for interoperability is not compatible with the devices against which the context is to be "
0205 "created. ";
0206
0207 case -1003: return "CL_INVALID_D3D10_RESOURCE_KHR clCreateFromD3D10BufferKHR, clCreateFromD3D10Texture2DKHR, "
0208 "clCreateFromD3D10Texture3DKHR If the resource is not a Direct3D 10 buffer or texture object ";
0209
0210 case -1004: return "CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR clEnqueueAcquireD3D10ObjectsKHR If a mem_object is "
0211 "already acquired by OpenCL ";
0212
0213 case -1005: return "CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR clEnqueueReleaseD3D10ObjectsKHR If a mem_object is not "
0214 "acquired by OpenCL ";
0215
0216 case -1006: return "CL_INVALID_D3D11_DEVICE_KHR clCreateContext, clCreateContextFromType if the Direct3D 11 device "
0217 "specified for interoperability is not compatible with the devices against which the context is to be "
0218 "created. ";
0219
0220 case -1007: return "CL_INVALID_D3D11_RESOURCE_KHR clCreateFromD3D11BufferKHR, clCreateFromD3D11Texture2DKHR, "
0221 "clCreateFromD3D11Texture3DKHR If the resource is not a Direct3D 11 buffer or texture object ";
0222
0223 case -1008: return "CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR clEnqueueAcquireD3D11ObjectsKHR If a mem_object is "
0224 "already acquired by OpenCL ";
0225
0226 case -1009: return "CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR clEnqueueReleaseD3D11ObjectsKHR If a ‘mem_object’ is not "
0227 "acquired by OpenCL ";
0228
0229 case -1010: return "CL_INVALID_D3D9_DEVICE_NV CL_INVALID_DX9_DEVICE_INTEL clCreateContext, "
0230 "clCreateContextFromType If the Direct3D 9 device specified for interoperability is not compatible with the devices against "
0231 "which the context is to be created ";
0232
0233 case -1011: return "CL_INVALID_D3D9_RESOURCE_NV CL_INVALID_DX9_RESOURCE_INTEL clCreateFromD3D9VertexBufferNV, "
0234 "clCreateFromD3D9IndexBufferNV, clCreateFromD3D9SurfaceNV, clCreateFromD3D9TextureNV, clCreateFromD3D9CubeTextureNV, "
0235 "clCreateFromD3D9VolumeTextureNV If a ‘mem_object’ is not a Direct3D 9 resource of the required type ";
0236
0237 case -1012: return "CL_D3D9_RESOURCE_ALREADY_ACQUIRED_NV CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL "
0238 "clEnqueueAcquireD3D9ObjectsNV If any of the ‘mem_objects’ is currently already acquired by OpenCL ";
0239
0240 case -1013: return "CL_D3D9_RESOURCE_NOT_ACQUIRED_NV CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL "
0241 "clEnqueueReleaseD3D9ObjectsNV If any of the ‘mem_objects’ is currently not acquired by OpenCL ";
0242
0243 case -1092: return "CL_EGL_RESOURCE_NOT_ACQUIRED_KHR clEnqueueReleaseEGLObjectsKHR If a ‘mem_object’ is not acquired "
0244 "by OpenCL ";
0245
0246 case -1093: return "CL_INVALID_EGL_OBJECT_KHR clCreateFromEGLImageKHR, clEnqueueAcquireEGLObjectsKHR If a "
0247 "‘mem_object’ is not a EGL resource of the required type ";
0248
0249 case -1094: return "CL_INVALID_ACCELERATOR_INTEL clSetKernelArg when ‘arg_value’ is not a valid accelerator object, and "
0250 "by clRetainAccelerator, clReleaseAccelerator, and clGetAcceleratorInfo when ‘accelerator’ is not a "
0251 "valid accelerator object ";
0252
0253 case -1095: return "CL_INVALID_ACCELERATOR_TYPE_INTEL clSetKernelArg, clCreateAccelerator when ‘arg_value’ is not an "
0254 "accelerator object of the correct type, or when ‘accelerator_type’ is not a valid accelerator type ";
0255
0256 case -1096: return "CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL clCreateAccelerator when values described by "
0257 "‘descriptor’ are not valid, or if a combination of values is not valid ";
0258
0259 case -1097: return "CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL clCreateAccelerator when ‘accelerator_type’ is a valid "
0260 "accelerator type, but it not supported by any device in ‘context’ ";
0261
0262 case -1098: return "CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL clCreateContext, clCreateContextFromType If the VA API "
0263 "display specified for interoperability is not compatible with the devices against which the context is to "
0264 "be created ";
0265
0266 case -1099: return "CL_INVALID_VA_API_MEDIA_SURFACE_INTEL clEnqueueReleaseVA_APIMediaSurfacesINTEL If ‘surface’ is "
0267 "not a VA API surface of the required type, by clGetMemObjectInfo when ‘param_name’ is "
0268 "CL_MEM_VA_API_MEDIA_SURFACE_INTEL when was not created from a VA API surface, and from clGetImageInfo when ‘param_name’ is "
0269 "CL_IMAGE_VA_API_PLANE_INTEL and ‘image’ was not created from a VA API surface ";
0270
0271 case -1100: return "CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL clEnqueueReleaseVA_APIMediaSurfacesINTEL If "
0272 "any of the ‘mem_objects’ is already acquired by OpenCL ";
0273
0274 case -1101: return "CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL clEnqueueReleaseVA_APIMediaSurfacesINTEL If any of "
0275 "the ‘mem_objects’ are not currently acquired by OpenCL ";
0276
0277 case -9999: return "NVidia clEnqueueNDRangeKernel Illegal read or write to a buffer ";
0278
0279 default: return "Unknown err_id";
0280 }
0281 }