I’ve run into the same problem just recently: due to memory limitations I have to use half precision floats in my OpenCL app. I was trying to use the “half” type in my kernel, but pretty soon I realized that it’s not really supported (on NVidia hardware, with the current drivers at least). Just by browsing through the OpenCL docu I noticed that they’re mentioning the IEEE754 as the floating point format descriptor. On wikipedia they describe pretty well what’s the story with that:
Basically I customized this code to run on the GPU, and I’m using it to convert my 32bit floats to 16bit floats (using singles2halfp(…) method), and I’m storing those into an “ushort” array, which could be then read / written, transferred back and forth between CPU-GPU and so on. When I want to access the values I have to convert them back to float32 first (using the halfp2singles(…) function). I know this could be ridiculously slow, un-optimal etc. but it solved my problem pretty well :-)
I hope that in the future OpenCL versions there will be proper support for half precision floats and I won’t have to tweak the stuff like this.