On Github Halo9Pan03 / presentation-cl
Cube - Page - Concave - Zoom - Linear - Fade - None - Default
Default - Sky - Beige - Simple - Serif - Night Moon - Solarized
非堵塞队列可以执行一个command-queue里面的command,并立即返回结果给host
OpenCL API提供command-queuebarrier
barrier命令确保command-queue里面已入队的command全部执行完成,然后才会执行command-queue里面后续的command
work-groupbarrierOpenCL C提供内建的work-groupbarrier
内建的barrier命令用来确保在work-group里面运行的work-item之间的同步
所有在work-group里面运行的work-item在继续运行之前,必须在barrier处等待
线性的存储字节序列的内存对象
Buffer通过在device上运行的kernel里面的指针访问
Buffer可以通过OpenCL API在host上操作
Buffer封装了以下信息:
size 属性和使用信息,分配范围 数据Built-in Kernel是运行在OpenCLdevice或者custom device上的一类kernel
application可以获得支持Built-in Kernel的device或者custom device列表
由OpenCL提交到command-queue里面执行的操作
Command-queue又context里面的特定device创建
Command-queue里面的command在队列里是有序的,但在执行时可以是in-order执行,也可以是out-of-order执行
一个或多个计算设备的内存
一个OpenCLdevice有一个或者多个Compute Unit
一个work-group在一个Compute Unit运行
一个Compute Unit又由一个或者多个processing element和local memory组成
一个Compute Unit也可能包含专用的,processing element可以访问的纹理过滤单元
并发可以在系统中同时运行多个任务,但需要程序员在代码中做任务的调度,并确保并发时数据的一致性的
OpenCL基于并发而生,但是对并发的控制及数据的同步仍然需要在代码中自行处理。
global memory中的一块区域,用来存储运行kernel时用到的常量
Constant Memory由host分配
kernel执行和内存管理及同步的一整套上下文
Context包含一系列的device,可访问这些device的内存,相应的内存属性,一个或多个用来执行kernel或者操作memory object的command-queue组成
Custom Device实现了OpenCL Runtime但是不支持OpenCL C
Custom Device虽然可能不是可编程硬件,但是往往有更高的效率,比如DSP
在一个program做并发运算时,里面的数据结构是一致的
一个Device由一系列的compute unit组成。
Device里面由command-queue控制command队列。
GPU,多核CPU,或者DSP,Cell/B.E都是OpenCL的Device
Event Wait List由多个event object组成,用于控制command的开始执行
Global ID在kernel执行时,全局唯一定义了一个work-item
Global ID是一个由(0, 0, … 0)开始的N维值
OpenCL应用可以使用OpenGL的buffer,texture和renderbuffer作为OpenCL的memory object,这样可以有效的在OpenCL和OpenGL之间共享数据。
OpenCL可以在kernel里面读写OpenGL的
memory objectOpenCL里面的任何操作都是通过引用句柄来完成的
Host通过OpenCL API与context交互
Host通常代表了一台主机,包含了一个或多个的device
Host pointer一般是指在主机里的内存地址
储存2维或者3维结构数组的memory object
Image Object只能被读或者写,而不能被映射
读操作通过sampler操作
Image Object封装了以下信息
image的维度 image每个元素的描述 属性和使用信息,分配范围 image数据OpenCL的一类执行模型,定义了command-queue里的command顺序执行
Kernel是在program里声明,在OpenCLdevice里面执行的函数
Kernel在program里用__kernel或者kernel关键字指定
Kernel Object封装了在program里定义的__kernel函数和__kernel函数所使用的参数值
Local ID在kernel里面执行的work-group里面指定了唯一的work-itemID
Local ID是一个由(0, 0, … 0)开始的N维值
分配给work-group的内存,并且仅work-group里面的work-item可以访问
Markercommand会返回一个event,application可以等待这个event
例如可以等待Marker之前的命令全部完成
OpenCL中的一个确切的内存地址
不同的内存区域可能在物理上会重叠,但OpenCL在逻辑上会区分
OpenCL的一类执行模型,定义了command-queue里的command非顺序执行
执行顺序通过Command-queue Barrier和Event Wait List控制
OpenCL的device可以创建sub device
但不是所有的parent device都是root device,root device分拆后的sub device可以进一步分拆。在这种场景下,第一层的sub device就是第二层的parent device,但是不是root device
OpenCL管理的host和device的集合,允许application共享resource并在device上执行kernel
由work-item私有的内存区域
虚拟的标量处理器
一个work-item可能运行在一个或多个Processing Element上
OpenCL Program由一系列的kernel组成
Program也包含__kernel函数调用的函数和常量数据
Program Object封装了以下信息
context的引用 program的源码或者二进制 build参数,build日志,build用到的device 最近引用的kernelOpenCL对象的生命周期由Reference Count决定,Reference Count表示引用该对象的内部数量
在OpenCL里创建一个对象后,该对象的Reference Count变为1,retainAPI(clRetainContext, clRetainCommandQueue...)会增加Reference Count,releaseAPI(clReleaseContext, clReleaseCommandQueue...)会减少Reference Count
当Reference Count为0后,OpenCL会回收对象的资源
一种内存一致性模型,不同work-item或者command可见的内存数据可以不一致,但是在barrier或者其它同步点需要做同步处理,使数据一致
常用的Resource是指context,command-queue,program,kernel和memory object
Computational Resources指一系列的运算硬件,比如host,device,compute unit和processing element
增加(retain)或减少(release)对OpenCL对象的引用数
Retain和Release的机制保证系统不会在对象相关的操作完成之前回收对象
当一个image对象读入到kernel中时,需要用Sampler来取样
Image的读取函数会有一个sampler作为参数
Sampler定义了image对象的地址模式(比如超出image坐标的数据处理),过滤模式已经image坐标轴是规格化或非规格化数值
一个kernel同时在多个processing element上运行,这些processing element有自己的数据并共享一个指令计数器
所有的processing element都执行严格一致的指令
一个kernel同时在多个processing element上运行,这些processing element有自己的数据和独立的指令计数器
因此,虽然所有的计算资源上运行相同的kernel,但它们维护自己的指令计数器和kernel中分支,指令的实际顺序在整个processing element组内是完全不同的
计算被分解成多个并发的任务,每个任务是一个在work-item数量为1的work-group里面运行的kernel
并发的任务可以运行在不同的kernel里面
如果在多个host线程同时调用的时候,内部状态由OpenCL管理并保持一致,则认为这个OpenCL的API调用是线程安全的
线程安全的OpenCL的API允许一个application的多个host线程同时调用,而不必在host的线程之间控制
一系列的在同一个compute unit上运行的work-item
在同一个Work-group里面运行的work-item执行同一个kernel,并且共享local memory和work group barrier
在一个device上通过一个command调用kernel并行执行
work-group在一个compute unit上运行,但是work-item会在一个或者多个processing element上运行
cl_int clGetPlatformIDs (cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms)clGetPlatformInfo
cl_int clGetPlatformInfo (cl_platform_id platform, cl_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_int clGetDeviceIDs (cl_platform_id platform, cl_device_type device_type, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices)clGetDeviceInfo
cl_int clGetDeviceInfo (cl_device_id device, cl_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_int clCreateSubDevices (cl_device_id in_device, const cl_device_partition_property *properties, cl_uint num_devices, cl_device_id *out_devices, cl_uint *num_devices_ret)clRetainDevice
cl_int clRetainDevice (cl_device_id device)clReleaseDevice
cl_int clReleaseDevice (cl_device_id device)
cl_context clCreateContext (const cl_context_properties *properties, cl_uint num_devices, const cl_device_id *devices, void (CL_CALLBACK *pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data), void *user_data, cl_int *errcode_ret)clGetContextInfo
cl_int clGetContextInfo (cl_context context, cl_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_context clCreateContextFromType (const cl_context_properties *properties, cl_device_type device_type, void (CL_CALLBACK *pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data), void *user_data, cl_int *errcode_ret)clRetainContext
cl_int clRetainContext (cl_context context)clReleaseContext
cl_int clReleaseContext (cl_context context)
cl_command_queue clCreateCommandQueue (cl_context context, cl_device_id device, cl_command_queue_properties properties, cl_int *errcode_ret)clRetainCommandQueue
cl_int clRetainCommandQueue (cl_command_queue command_queue)clReleaseCommandQueue
cl_int clReleaseCommandQueue (cl_command_queue command_queue)clGetCommandQueueInfo
cl_int clGetCommandQueueInfo (cl_command_queue command_queue, cl_command_queue_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_mem clCreateBuffer (cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret)clCreateSubBuffer
cl_mem clCreateSubBuffer (cl_mem buffer, cl_mem_flags flags, cl_buffer_create_type buffer_create_type, const void *buffer_create_info, cl_int *errcode_ret)
cl_int clEnqueueReadBuffer (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, size_t offset, size_t size, void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
cl_int clEnqueueWriteBuffer (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write, size_t offset, size_t size, const void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将一块2D或3D矩形区域从buffer object写到host的内存中
cl_int clEnqueueReadBufferRect (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, const size_t *buffer_origin, const size_t *host_origin, const size_t *region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将一块2D或3D矩形区域从host的内存中写入到buffer object
cl_int clEnqueueWriteBufferRect (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write, const size_t *buffer_origin, const size_t *host_origin, const size_t *region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, const void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将src_buffer指定的buffer object拷贝到由dst_buffer指定的buffer object
cl_int clEnqueueCopyBuffer (cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, size_t dst_offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将一块2D或3D矩形区域从src_buffer指定的buffer object拷贝到由dst_buffer指定的buffer object
cl_int clEnqueueCopyBufferRect (cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer, const size_t *src_origin, const size_t *dst_origin, const size_t *region, size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch, size_t dst_slice_pitch, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,通过pattern和pattern_size过滤一个buffer object
cl_int clEnqueueFillBuffer (cl_command_queue command_queue, cl_mem buffer, const void *pattern, size_t pattern_size, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将buffer指定的buffer object映射到host的内存空间中,并返回一个指向映射空间的指针
void * clEnqueueMapBuffer (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event, cl_int *errcode_ret)
Image 格式描述
typedef struct _cl_image_format { cl_channel_order image_channel_order; cl_channel_type image_channel_data_type; } cl_image_format;
Image 描述
typedef struct _cl_image_desc { cl_mem_object_type image_type, size_t image_width; size_t image_height; size_t image_depth; size_t image_array_size; size_t image_row_pitch; size_t image_slice_pitch; cl_uint num_mip_levels; cl_uint num_samples; cl_mem buffer; } cl_image_desc;
创建 1D image,1D image buffer,1D image array,2D image,2D image array 和 3D image object
cl_mem clCreateImage (cl_context context, cl_mem_flags flags, const cl_image_format *image_format, const cl_image_desc *image_desc, void *host_ptr, cl_int *errcode_ret)clGetSupportedImageFormats
获取OpenCL实现所支持的 image 格式
cl_int clGetSupportedImageFormats (cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, cl_uint num_entries, cl_image_format *image_formats, cl_uint *num_image_formats)
入队一个 command,从 image 或者 image array 对象读取到 host 的内存中
cl_int clEnqueueReadImage (cl_command_queue command_queue, cl_mem image, cl_bool blocking_read, const size_t *origin, const size_t *region, size_t row_pitch, size_t slice_pitch, void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,从 host 的内存中将数据写入到 image 或者 image array 对象
cl_int clEnqueueWriteImage (cl_command_queue command_queue, cl_mem image, cl_bool blocking_write, const size_t *origin, const size_t *region, size_t input_row_pitch, size_t input_slice_pitch, const void * ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,拷贝 image 对象,src_image和dst_image可以为 1D, 2D, 3D image 或者 a 1D, 2D image array
cl_int clEnqueueCopyImage (cl_command_queue command_queue, cl_mem src_image, cl_mem dst_image, const size_t *src_origin, const size_t *dst_origin, const size_t *region, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将 image 对象填充特定的颜色fill_color
cl_int clEnqueueFillImage (cl_command_queue command_queue, cl_mem image, const void *fill_color, const size_t *origin, const size_t *region, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,拷贝 image 对象src_image到 buffer 对象dst_buffer
cl_int clEnqueueCopyImageToBuffer (cl_command_queue command_queue, cl_mem src_image, cl_mem dst_buffer, const size_t *src_origin, const size_t *region, size_t dst_offset, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,拷贝 buffer 对象dst_buffer到 image 对象src_image
cl_int clEnqueueCopyBufferToImage (cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, const size_t *dst_origin, const size_t *region, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,将 image 对象image内的一块区域映射到 host 的内存空间,并返回一个指向该空间的指针
void * clEnqueueMapImage (cl_command_queue command_queue, cl_mem image, cl_bool blocking_map, cl_map_flags map_flags, const size_t *origin, const size_t *region, size_t *image_row_pitch, size_t *image_slice_pitch, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event, cl_int *errcode_ret)
获取 image 对象image的信息
cl_int clGetImageInfo (cl_mem image, cl_image_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_int clRetainMemObject (cl_mem memobj)clReleaseMemObject
cl_int clReleaseMemObject (cl_mem memobj)clSetMemObjectDestructorCallback
注册一个 memory 对象销毁时的回调函数
cl_int clSetMemObjectDestructorCallback (cl_mem memobj, void (CL_CALLBACK *pfn_notify)(cl_mem memobj, void *user_data), void *user_data)
入队一个 command,将之前映射过的 memory 对象取消映射关系
cl_int clEnqueueUnmapMemObject (cl_command_queue command_queue, cl_mem memobj, void *mapped_ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)clEnqueueMigrateMemObjects
入队一个 command,用于在不同的 device 间同步 memory 对象
cl_int clEnqueueMigrateMemObjects (cl_command_queue command_queue, cl_uint num_mem_objects, const cl_mem *mem_objects, cl_mem_migration_flags flags, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
获取 memory 对象memobj的信息
cl_int clGetMemObjectInfo (cl_mem memobj, cl_mem_info param_name, size_t param_value_sizMemorye, void *param_value, size_t *param_value_size_ret)
创建 sampler 对象cl_sampler
cl_sampler clCreateSampler (cl_context context, cl_bool normalized_coords, cl_addressing_mode addressing_mode, cl_filter_mode filter_mode, cl_int *errcode_ret)clRetainSampler
cl_int clRetainSampler (cl_sampler sampler)clReleaseSampler
cl_int clReleaseSampler (cl_sampler sampler)
获取 sampler 对象sampler信息
cl_int clGetSamplerInfo (cl_sampler sampler, cl_sampler_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
通过文本源码strings创建 program 对象
cl_program clCreateProgramWithSource (cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_int *errcode_ret)clCreateProgramWithBinary
通过二进制内容binaries创建 program 对象
cl_program clCreateProgramWithBinary (cl_context context, cl_uint num_devices, const cl_device_id *device_list, const size_t *lengths, const unsigned char **binaries, cl_int *binary_status, cl_int *errcode_ret)
通过内建的 kernel kernel_names创建 program 对象
cl_program clCreateProgramWithBuiltInKernels (cl_context context, cl_uint num_devices, const cl_device_id *device_list, const char *kernel_names, cl_int *errcode_ret)clRetainProgram
cl_int clRetainProgram (cl_program program)clReleaseProgram
cl_int clReleaseProgram (cl_program program)
构建(build) program 对象,包含了编译(compile)和链接(link)两个步骤,一起完成
cl_int clBuildProgram (cl_program program, cl_uint num_devices, const cl_device_id *device_list, const char *options, void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void *user_data)
编译(compile) program 对象
cl_int clCompileProgram (cl_program program, cl_uint num_devices, const cl_device_id *device_list, const char *options, cl_uint num_input_headers, const cl_program *input_headers, const char **header_include_names, void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void *user_data)
链接(link) program 对象
cl_program clLinkProgram (cl_context context, cl_uint num_devices, const cl_device_id *device_list, const char *options, cl_uint num_input_programs, const cl_program *input_programs, void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void *user_data, cl_int *errcode_ret)
释放编译(compile) program 对象时用到的资源
cl_int clUnloadPlatformCompiler (cl_platform_id platform)clGetProgramInfo
获取 program 对象的信息
cl_int clGetProgramInfo (cl_program program, cl_program_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
获取 program 对象构建(build)的信息
cl_int clGetProgramBuildInfo (cl_program program, cl_device_id device, cl_program_build_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
创建一个 kernel 对象
cl_kernel clCreateKernel (cl_program program, const char *kernel_name, cl_int *errcode_ret)clCreateKernelsInProgram
创建 program 里面所有的 kernel 对象
cl_int clCreateKernelsInProgram (cl_program program, cl_uint num_kernels, cl_kernel *kernels, cl_uint *num_kernels_ret)clRetainKernel
cl_int clRetainKernel (cl_kernel kernel)clReleaseKernel
cl_int clReleaseKernel (cl_kernel kernel)
设置 kernel 参数
cl_int clSetKernelArg (cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value)clGetKernelArgInfo
获取 kernel 参数信息
cl_int clGetKernelArgInfo (cl_kernel kernel, cl_uint arg_indx, cl_kernel_arg_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
获取 kernel 对象的信息
cl_int clGetKernelInfo (cl_kernel kernel, cl_kernel_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)clGetKernelWorkGroupInfo
获取 kernel 对象里面 work-group 的信息
cl_int clGetKernelWorkGroupInfo (cl_kernel kernel, cl_device_id device, cl_kernel_work_group_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
入队一个 command,在 kernel 里面执行,Data Parallel Programming Model
cl_int clEnqueueNDRangeKernel (cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,在 kernel 里面执行,Task Parallel Programming Model
cl_int clEnqueueTask (cl_command_queue command_queue, cl_kernel kernel, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
入队一个 command,执行 native kernel
cl_int clEnqueueNativeKernel (cl_command_queue command_queue, void (CL_CALLBACK *user_func)(void *) void *args, size_t cb_args, cl_uint num_mem_objects, const cl_mem *mem_list, const void **args_mem_loc, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
clEnqueueNDRangeKernel
clEnqueueTask
clEnqueueNativeKernel
clEnqueueReadBuffer
clEnqueueWriteBuffer
clEnqueueMapBuffer
clEnqueueUnmapMemObject
clEnqueueReadBufferRect
clEnqueueWriteBufferRect
clEnqueueReadImage
clEnqueueWriteImage
clEnqueueMapImage
clEnqueueCopyBuffer
clEnqueueCopyImage
clEnqueueCopyBufferRect
clEnqueueCopyBufferToImage
clEnqueueCopyImageToBuffer
clEnqueueMarkerWithWaitList
clEnqueueBarrierWithWaitList
cl_event clCreateUserEvent (cl_context context, cl_int *errcode_ret)clSetUserEventStatus
cl_int clSetUserEventStatus (cl_event event, cl_int execution_status)clWaitForEvents
cl_int clWaitForEvents (cl_uint num_events, const cl_event *event_list)clGetEventInfo
cl_int clGetEventInfo (cl_event event, cl_event_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_int clSetEventCallback (cl_event event, cl_int command_exec_callback_type, void (CL_CALLBACK *pfn_event_notify)(cl_event event, cl_int event_command_exec_status, void *user_data), void *user_data)clRetainEvent
cl_int clRetainEvent (cl_event event)clReleaseEvent
cl_int clReleaseEvent (cl_event event)
cl_int clEnqueueMarkerWithWaitList (cl_command_queue command_queue, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
cl_int clEnqueueBarrierWithWaitList (cl_command_queue command_queue, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
cl_int clGetEventProfilingInfo (cl_event event, cl_profiling_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
cl_int clFlush (cl_command_queue command_queue)
cl_int clFinish (cl_command_queue command_queue)
cl_int clGetPlatformIDs (cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms)clGetPlatformInfo
cl_int clGetPlatformInfo (cl_platform_id platform, cl_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)