PDA

View Full Version : half conversion in host code



coleb
10-01-2009, 05:00 PM
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.

Thanks,
Brian Cole

dbs2
10-01-2009, 10:13 PM
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.

coleb
10-02-2009, 07:45 PM
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.