Errors

Following are the errors encountered in OpenCL. For descriptions of errors as they pertain to specific functions, refer to the reference pages for those functions.

Error Description
CL_BUILD_PROGRAM_FAILURE

Returned by clBuildProgram if there is a failure to build the program executable. This error will be returned if clBuildProgram does not return until the build has completed.

CL_COMPILER_NOT_AVAILABLE

Returned by clBuildProgram if the parameter program is created with clCreateProgramWithSource and a compiler is not available. For example CL_DEVICE_COMPILER_AVAILABLE is set to CL_FALSE.

CL_DEVICE_NOT_AVAILABLE

Returned by clCreateContext and clCreateContextFromType if the specified device is not currently available.

CL_DEVICE_NOT_FOUND

Returned by clGetDeviceIDs and clCreateContextFromType if no OpenCL devices that match the specified devices were found.

CL_IMAGE_FORMAT_MISMATCH

Returned by clEnqueueCopyImage if the specified source and destination images are not valid image objects.

CL_IMAGE_FORMAT_NOT_SUPPORTED

Returned by clCreateImage2D and clCreateImage3D if the specified image format is not supported.

CL_INVALID_ARG_INDEX

Returned by clSetKernelArg if an invalid argument index is specified.

CL_INVALID_ARG_SIZE

Returned by clSetKernelArg if argument size specified (arg_size) does not match the size of the data type for an argument that is not a memory object, or if the argument is a memory object and arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler).

CL_INVALID_ARG_VALUE

Returned by clSetKernelArg if the argument value specified is NULL for an argument that is not declared with the __local qualifier or vice-versa.

CL_INVALID_BINARY

Returned by clBuildProgram and clCreateProgramWithBinary if the program binary is not a valid binary for the specified device.

CL_INVALID_BUFFER_SIZE

Returned by clCreateBuffer if the value of the parameter size is 0 or is greater than CL_DEVICE_MAX_MEM_ALLOC_SIZE for all devices specified in the parameter context.

CL_INVALID_BUILD_OPTIONS

Returned by clBuildProgram if the specified build options are invalid.

CL_INVALID_COMMAND_QUEUE

Returned by the functions listed below if the specified command-queue is not a valid command-queue. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clRetainCommandQueue, clReleaseCommandQueue, clGetCommandQueueInfo, clSetCommandQueueProperty, clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueCopyBuffer, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clEnqueueNDRangeKernel, clEnqueueTask, clEnqueueNativeKernel, clEnqueueMarker, clEnqueueWaitForEvents, clEnqueueBarrier, clFlush, clFinish, clEnqueueAcquireGLObjects, and clEnqueueReleaseGLObjects

CL_INVALID_CONTEXT

Returned by the functions listed below if the specified context is not a valid OpenCL context, or the context associated with certain parameters are not the same. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clRetainContext, clReleaseContext, clGetContextInfo, clCreateCommandQueue, clCreateBuffer, clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueCopyBuffer, clCreateImage2D, clCreateImage3D, clGetSupportedImageFormats, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clCreateSampler, clCreateProgramWithSource, clCreateProgramWithBinary, clEnqueueNDRangeKernel, clEnqueueTask, clEnqueueNativeKernel, clWaitForEvents, clEnqueueWaitForEvents, clCreateFromGLBuffer, clCreateFromGLTexture2D, clCreateFromGLTexture3D, clCreateFromGLRenderbuffer, clEnqueueAcquireGLObjects, and clEnqueueReleaseGLObjects

CL_INVALID_DEVICE

Returned by the functions listed below if the device or devices specified are not valid. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clGetDeviceIDs, clGetDeviceInfo, clCreateContext, clCreateContextFromType, clCreateCommandQueue, clCreateProgramWithBinary, clBuildProgram, clGetProgramBuildInfo, and clGetKernelWorkGroupInfo

CL_INVALID_DEVICE_TYPE

Returned by clGetDeviceIDs and clCreateContextFromType if device type specified is not valid.

CL_INVALID_EVENT

Returned by the functions listed below if the event objects specified are not valid. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clWaitForEvents, clGetEventInfo, clRetainEvent, clReleaseEvent, clEnqueueWaitForEvents, and clGetEventProfilingInfo

CL_INVALID_EVENT_WAIT_LIST

Returned by the functions listed below if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list_list is not NULL and num_events_in_wait_list is 0, or specified event objects are not valid events. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueCopyBuffer, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clEnqueueNDRangeKernel, clEnqueueTask, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clEnqueueNDRangeKernel, clEnqueueAcquireGLObjects, and clEnqueueReleaseGLObjects

CL_INVALID_GL_OBJECT

Returned by clCreateFromGLBuffer if bufobj is not a GL buffer object or is a GL buffer object but does not have an existing data store.

Returned by clCreateFromGLRenderbuffer if renderbuffer is not a GL renderbuffer object or if the width or height of renderbuffer is zero.

Returned by clCreateFromGLTexture2D and clCreateFromGLTexture3D if texture is not a GL texture object whose type matches texture_target, if the specified miplevel of texture is not defined, or if the width, height or depth of the specified miplevel is zero.

Returned by clGetGLObjectInfo and clGetGLTextureInfo if there is no GL object or texture associated with memobj.

Returned by clEnqueueAcquireGLObjects and clEnqueueReleaseGLObjects if memory objects in mem_objects have not been created from a GL object(s). The exact condition that generates this error depends on the calling function.

CL_INVALID_GLOBAL_OFFSET

Returned by clEnqueueNDRangeKernel if global_work_offset is not NULL.

CL_INVALID_HOST_PTR

Returned by the functions listed below if host_ptr is NULL and CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are set in flags or if host_ptr is not NULL but CL_MEM_COPY_HOST_PTR or CL_MEM_USE_HOST_PTR are not set in flags. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the functions clCreateBuffer, clCreateImage2D, and clCreateImage3D.

CL_INVALID_IMAGE_FORMAT_DESCRIPTOR

Returned by clCreateImage2D and clCreateImage3D if the image format specified is not valid or is NULL.

Returned byclCreateFromGLTexture2D and clCreateFromGLTexture3D

Returned by clCreateFromGLRenderbuffer if the OpenGL renderbuffer internal format does not map to a supported OpenCL image format.

CL_INVALID_IMAGE_SIZE

Returned by clCreateImage2D if the specified image width or height are 0 or if they exceed values specified in CL_DEVICE_IMAGE2D_MAX_WIDTH or CL_DEVICE_IMAGE2D_MAX_HEIGHT respectively for all devices in context, or if the specified image row pitch does not follow rules described for clCreateImage2D.

Returned by clCreateImage3D if the specified image width or height are 0 or if the image depth is <= 1, or if they exceed values specified in CL_DEVICE_IMAGE3D_MAX_WIDTH, CL_DEVICE_IMAGE3D_MAX_HEIGHT or CL_DEVICE_IMAGE3D_MAX_DEPTH respectively for all devices in context, or if the image row pitch and image slice pitch do not follow rules described for clCreateImage3D.

CL_INVALID_KERNEL_NAME

Returned by clCreateKernel if the specified kernel name is not found in program.

CL_INVALID_KERNEL

Returned by the functions listed below if the specified kernel is not a valid kernel object. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clReleaseKernel, clRetainKernel, clSetKernelArg, clGetKernelInfo, clGetKernelWorkGroupInfo, clEnqueueNDRangeKernel, and clEnqueueTask

CL_INVALID_KERNEL_ARGS

Returned by clEnqueueNDRangeKernel and clEnqueueTask if the kernel argument values have not been specified.

CL_INVALID_KERNEL_DEFINITION

Returned by clCreateKernel if the function definition for __kernel function given by kernel_name such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built.

CL_INVALID_MEM_OBJECT

Returned by the functions listed below if a parameter is not a valid memory, image, or buffer object. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueCopyBuffer, clRetainMemObject, clReleaseMemObject, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clGetMemObjectInfo, clGetImageInfo, clSetKernelArg, clEnqueueNativeKernel, clGetGLObjectInfo, clGetGLTextureInfo, clEnqueueAcquireGLObjects, and clEnqueueReleaseGLObjects

CL_INVALID_OPERATION

Returned by clCreateImage2D, clCreateImage3D, and clCreateSampler if there are no devices in context that support images.

Returned by clBuildProgram if the build of a program executable for any of the devices specified by a previous call to clBuildProgram for program has not completed, or if there are kernel objects attached to program.

Returned by clEnqueueNativeKernel if the specified device cannot execute the native kernel.

Returned by clCreateFromGLTexture2D if the miplevel is less than 0.

Returned by clCreateFromGLTexture3D if 3D images are not supported by the OpenCL embedded profile.

CL_INVALID_PLATFORM

Returned by clGetPlatformInfo and clGetDeviceIDs if the specified platform is not a valid platform.

Returned by clCreateContext and clCreateContextFromType if properties is NULL and no platform could be selected, or if platform value specified in properties is not a valid platform.

CL_INVALID_PROGRAM

Returned by the functions listed below if the specified program is not a valid program object. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clRetainProgram, clReleaseProgram, clBuildProgram, clGetProgramInfo, clGetProgramBuildInfo, clCreateKernel, and clCreateKernelsInProgram

CL_INVALID_PROGRAM_EXECUTABLE

Returned by clCreateKernel if there is no successfully built executable for program, and returned by clCreateKernelsInProgram if there is no device in program.

Returned by clEnqueueNDRangeKernel and clEnqueueTask if there is no successfully built program executable available for device associated with command_queue.

CL_INVALID_QUEUE_PROPERTIES

Returned by clCreateCommandQueue and clSetCommandQueueProperty if specified properties are valid but are not supported by the device.

CL_INVALID_SAMPLER

Returned by clRetainSampler, clReleaseSampler, and clGetSamplerInfo if the specified sampler is not a valid sampler object.

Returned by clSetKernelArg for an argument declared to be of type sampler_t when the specified arg_value is not a valid sampler object.

CL_INVALID_VALUE

Returned by the functions listed below if a parameter is not an expected value. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clGetPlatformIDs, clGetPlatformInfo, clGetDeviceIDs, clGetDeviceInfo, clCreateContext, clCreateContextFromType, clGetContextInfo, clCreateCommandQueue, clGetCommandQueueInfo, clSetCommandQueueProperty, clCreateBuffer, clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueCopyBuffer, clCreateImage2D, clCreateImage3D, clGetSupportedImageFormats, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clGetMemObjectInfo, clGetImageInfo, clCreateSampler, clGetSamplerInfo, clCreateProgramWithSource, clCreateProgramWithBinary, clBuildProgram, clGetProgramInfo, clGetProgramBuildInfo, clCreateKernel, clCreateKernelsInProgram, clGetKernelInfo, clGetKernelWorkGroupInfo, clEnqueueNativeKernel, clWaitForEvents, clGetEventInfo, clEnqueueMarker, clEnqueueWaitForEvents, clGetEventProfilingInfo, clCreateFromGLBuffer, clCreateFromGLTexture2D, clCreateFromGLTexture3D, clCreateFromGLRenderbuffer, clGetGLTextureInfo, and clEnqueueAcquireGLObjects

CL_INVALID_WORK_DIMENSION

Returned by clEnqueueNDRangeKernel if work_dim is not a valid value.

CL_INVALID_WORK_GROUP_SIZE

Returned by clEnqueueNDRangeKernel and clEnqueueTask if local_work_size is specified and number of workitems specified by global_work_size is not evenly divisible by size of work-group given by local_work_size or does not match the work-group size specified for kernel using the __attribute__((reqd_work_group_size(X, Y, Z))) qualifier in program source.

CL_INVALID_WORK_ITEM_SIZE

Returned by clEnqueueNDRangeKernel if the number of work-items specified in any of local_work_size... [0]... local_work_size[work_dim - 1] is greater than the corresponding values specified by CL_DEVICE_MAX_WORK_ITEM_SIZES[0],... CL_DEVICE_MAX_WORK_ITEM_SIZES[work_dim -1].

CL_MAP_FAILURE

Returned by clEnqueueMapBuffer and clEnqueueMapImage if there is a failure to map the requested region into the host address space. This error cannot occur for buffer objects created with CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR.

CL_MEM_OBJECT_ALLOCATION_FAILURE

Returned by the functions listed below if there is a failure to allocate memory for data store associated with image or buffer objects specified as arguments to kernel. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clCreateBuffer, clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueCopyBuffer, clCreateImage2D, clCreateImage3D, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueNDRangeKernel, clEnqueueTask, and clEnqueueNativeKernel

CL_MEM_COPY_OVERLAP

Returned by clEnqueueCopyBuffer and clEnqueueCopyImage if the source and destination images are the same image (or the source and destination buffers are the same buffer), and the source and destination regions overlap.

CL_OUT_OF_HOST_MEMORY

Returned by the functions listed below in the event of a failure to allocate resources required by the OpenCL implementation on the host. The exact condition that generates this error depends on the calling function. Refer to the function for more information.

Returned by the following functions: clCreateContext, clCreateContextFromType, clCreateCommandQueue, clCreateBuffer, clEnqueueCopyBuffer, clCreateImage2D, clCreateImage3D, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueUnmapMemObject, clCreateSampler, clCreateProgramWithSource, clCreateProgramWithBinary, clBuildProgram, clCreateKernel, clCreateKernelsInProgram, clEnqueueNDRangeKernel, clEnqueueTask, clEnqueueNativeKernel, clEnqueueMarker, clEnqueueWaitForEvents, clEnqueueBarrier, clFlush, clFinish, clCreateFromGLBuffer, clCreateFromGLTexture2D, clCreateFromGLTexture3D, clCreateFromGLRenderbuffer, clEnqueueAcquireGLObjects, and clEnqueueReleaseGLObjects

CL_OUT_OF_RESOURCES

Returned by clEnqueueNDRangeKernel, clEnqueueTask, and clEnqueueNativeKernel in the event of a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel.

CL_PROFILING_INFO_NOT_AVAILABLE

Returned by clGetEventProfilingInfo if the CL_QUEUE_PROFILING_ENABLE flag is not set for the command-queue and the profiling information is currently not available (because the command identified by event has not completed).

CL_SUCCESS

Indicates that the function executed successfully.

Copyright © Copyright © 2007-2009 The Khronos Group Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.