- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When running (and developing) the OpenCL part of Piglit testing framework (http://piglit.freedesktop.org/) I've stumbled across a few bugs on Intel OpenCL SDK.
In this post I try to provide as much info on how to reproduce each reported bug. Most of the bugs (but not all of them) are wrongly reported error codes and they don't affect the application when the SDK is used properly. If you need more details on each bug you can run Piglit or ask me about each particular bug.
I apologize in advance for any errors in this post, especially in the copied code. If you find any errors in this post or tests please inform me.
Hardware:
Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz
Software:
Linux 64-bit (Archlinux)
OpenCL SDK 2012 (http://registrationcenter.intel.com/irc_nas/2563/intel_sdk_for_ocl_applications_2012_x64.tgz)
Bugs:
1. Crashes (mostly segfaults):
1.1. clBuildProgram should return CL_INVALID_VALUE if device_list is NULL and num_devices is greater than zero. Example:
clBuildProgram(program, 1, NULL, "", NULL, NULL)
1.2. clCreateBuffer should return CL_INVALID_VALUE if values specified in flags are not valid. Example:
clCreateBuffer(context, CL_MEM_READ_ONLY|CL_MEM_READ_WRITE, 512, NULL, NULL)
1.3. clCreateContextFromType should return CL_INVALID_PLATFORM if platform value specified in properties is not a valid platform. Example:
clCreateContextFromType({CL_CONTEXT_PLATFORM, (cl_context_properties)1, 0}, CL_DEVICE_TYPE_ALL, NULL, NULL, NULL)
1.4. clCreateKernel should return CL_INVALID_KERNEL_NAME if kernel_name is not found in program. Reported error:
terminate called after throwing an instance of 'Intel::OpenCL::DeviceBackend::Exceptions::DeviceBackendExceptionBase'
what(): No kernel found for given name
Example:
clCreateKernel(program, "nonexistent_name", NULL)
1.5 clCreateProgramWithSource should return CL_INVALID_VALUE if any entry in strings is NULL. Example:
clCreateProgramWithSource(context, 1, &null_string, NULL, NULL)
1.6 clEnqueueReadBuffer should return CL_INVALID_EVENT_WAIT_LIST event objects in event_wait_list are not valid events. Example:
clEnqueueReadBuffer(cq, buffer, true, 0, size, data_ptr, 1, &invalid_event, NULL)
1.7. clGetDeviceIDs should return CL_INVALID_PLATFORM if platform is not a valid platform. Example:
clGetDeviceIDs((cl_platform_id)1, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices)
1.8. clGetPLatformInfo should return CL_INVALID_PLATFORM if platform is not a valid platform. Example:
clGetPlatformInfo((cl_platform_id)1, CL_PLATFORM_PROFILE, 0, NULL, ¶m_size)
2. Invalid returned error codes:
Most of descriptions have this format:
(expected error code) action to produce an error code
2.1. clCreateContext:
- (error code: CL_SUCCESS): Trigger CL_INVALID_PLATFORM if platform value specified in properties is not a valid platform. Example:
clCreateContext({CL_CONTEXT_PLATFORM, (cl_context_properties)1, 0}, num_devices, devices, NULL, NULL, NULL)
- (error code: (unrecognized error)): Trigger CL_INVALID_VALUE if devices is NULL. Example:
clCreateContext({CL_CONTEXT_PLATFORM, (cl_context_properties)platform_id, 0}, num_devices, NULL, NULL, NULL, NULL)
- (error code: CL_SUCCESS): Trigger CL_INVALID_PROPERTY if context property name in poperties is not a supported property name. Example:
clCreateContext({CL_DEVICE_NAME, (cl_context_properties)platform_id, 0}, num_devices, devices, NULL, NULL, NULL)
- (error code: CL_SUCCESS): Trigger CL_INVALID_PROPERTY if the same property is specified more than once. Example:
clCreateContext({CL_CONTEXT_PLATFORM, (cl_context_properties)platform_id, CL_CONTEXT_PLATFORM, (cl_context_properties)platform_id, 0}, num_devices, devices, NULL, NULL, NULL)
2.2 clCreateProgramWithSource:
- (error code: CL_SUCCESS): Trigger CL_INVALID_VALUE when count is zero. Example:
clCreateProgramWithSource(context, 0, strings, NULL, NULL)
- (error code: CL_SUCCESS): Trigger CL_INVALID_VALUE when strings is NULL. Example:
clCreateProgramWithSource(context, 0, NULL, NULL, NULL)
2.3. clGetKernelWorkGroupInfo:
- (error code: CL_INVALID_KERNEL): Trigger CL_INVALID_DEVICE if device is NULL but there is more than one device associated with kernel. Example:
clGetKernelWorkGroupInfo(kernel, NULL, CL_KERNEL_WORK_GROUP_SIZE, 0, NULL, ¶m_size)
2.4 clGetMemObjectInfo:
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_TYPE.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_FLAGS.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_SIZE.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_HOST_PTR.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_MAP_COUNT.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_REFERENCE_COUNT.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_CONTEXT.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_ASSOCIATED_MEMOBJECT.
- (error code: CL_INVALID_VALUE): Get size of CL_MEM_OFFSET. Example:
clGetMemObjectInfo(mem_obj, CL_MEM_OFFSET, 0, NULL, ¶m_size)
3. Other:
3.1. clCreateBuffer does not initialize buffer data properly when using CL_MEM_WRITE_ONLY|CL_MEM_USE_HOST_PTR. When reading with clEnqueueReadBuffer from the created buffer we get different data than the data passed to clCreateBuffer. Example:
buffer = clCreateBuffer(context, CL_MEM_WRITE_ONLY|CL_MEM_USE_HOST_PTR, 512, data_ptr, NULL)
clEnqueueReadBuffer(com_queue, buffer, true, 0, 512, read_data_ptr, 0, NULL, NULL)
3.2. clGetDeviceInfo doesn't return CL_SUCCESS (and appropriate data) when requesting CL_DEVICE_PLATFORM, but instead it returns CL_INVALID_VALUE. Example:
clGetDeviceInfo(device, CL_INVALID_DEVICE, 0, NULL, ¶m_size)
3.3 clSetKernelArg doesn't return CL_INVALID_ARG_SIZE if arg_size is zero and the argument is declared with the __local qualifier, instead it return CL_SUCCESS. Example:
kernel_source = "kernel void ker(__local int* int_ptr){}"
clSetKernelArg(kernel, 0, 0, NULL)
4. Programs that fail to build:
http://cgit.freedesktop.org/piglit/plain/tests/cl/program/execute/scalar-bitwise-int.cl
http://cgit.freedesktop.org/piglit/plain/tests/cl/program/execute/scalar-logical-float.cl
http://cgit.freedesktop.org/piglit/plain/tests/cl/program/execute/scalar-logical-int.cl
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page