2

I know OpenCL supports inline functions, but can those functions accept and return OpenCL types?

Specifically, I am interested in something with this signature: float4 func(float4 x, float4 y)

4

2 回答 2

4

是的,对于大多数 GPU,所有函数都是内联的,即使您没有指定它。

于 2010-08-26T17:59:33.823 回答
3

只有内核函数具有特定的返回类型,即 void。任何其他函数都可以返回任何有效的 OpenCL 类型。

于 2010-09-02T21:31:06.683 回答