half conversion in host code

Feature request. Currently converting from float to half requires either sending the data to the GPU, or twiddling the bits yourself. Neither are rather savory. Why not include the convert_* functions on the host side? Theoretically they could be implemented as nice SIMD vector operations on the CPU too.

Brian Cole

You should be able to get a high-performance version of just this by writing a kernel to run on the CPU that does the conversion and uses CL_USE_HOST_PTR for the input memory object to avoid an extra copy.

Didn’t think of that. Thanks for the advice.