【入门】OpenCL C的限制

来源:互联网 发布:2017全国进出口数据 编辑:程序博客网 时间:2024/05/20 22:39

OpenCL C编程语言是用来编写内核代码的编程语言。它是基于ISO C99标准的一个扩展子集,有着如下限制:


The pointer passed as an argument to a kernel function must be of type __global, __constant, or __local. 
传入kernel的指针参数必须是__global, __constant, 或者__local型的. 


Pointer to a pointer cannot be passed as an argument to a kernel function.
指向指针的指针不可以作为参数传给kernel函数。


Bit-fields are not supported.
不支持Bit-fields。


Variable length arrays and structures with flexible (or unsized) arrays are not supported.
不支持可变长度的数组和包含不确定长度的结构体。


Variadic macros and functions are not supported.
不支持可以改变参数的宏和方法。

C99 standard headers cannot be included.
不能引入C99标准的头文件。

The extern, static, auto and register storage-class specifiers are not supported.
不支持extern, static, auto 和 register storage-class 声明符。

Predefined identifiers are not supported. 
不支持预定于标示符。

Recursion is not supported.
不支持递归。

The function using the __kernel qualifier can only have return type void in the source code.
用__kernel限定的函数只能返回空类型。

Writes to a pointer of type char, uchar, char2, uchar2, short, ushort, and half are not supported.
不支持指向char, uchar, char2, uchar2, short, ushort, and half型的指针。

Support for double precision floating-point is currently an optional extension. It may or may not be implemented.
双精度float型指针现在是一个可选扩展,它不一定会不会实现。