views:

72

answers:

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)

+1  A: 

Yes, for most GPUs, all functions are inlined anyway, even if you don't specify it.

Matias Valdenegro
As far as I know, ATI's and NVidia's CL compilers *always* inline for performance reasons. The hardware can support function calls, but it's slow.
dietr
A: 

Only kernel functions has a specific return type which is void. Any other function can return any valid OpenCL type.

Kayhano