PDA

View Full Version : Complex type



moonlai
12-29-2009, 01:58 PM
Can I use complex type in the kernel? For example, complex float?
If it can, how? Thanks a lot.

dbs2
01-04-2010, 12:44 AM
There are no built-in complex types in OpenCL 1.0. You can use a float2 vector and manually treat it as complex, but you will have to do the math explicitly. If you take this approach you should get some benefit of auto-vectorization on compatible hardware for supported operations. (e.g., float2 + float2 should do two adds in parallel if the hardware supports it)