Is there a way to read half2 values directly from a 2D texture with half precision data?
I am converting CUDA code to use half precision and would like to use:
half2 val = tex2D(tex, x, y);
instead of the current:
float2 val = tex2D(tex, x, y);
The version with does not compile. The documentation seems to indicate that this is not possible, but I wanted to make sure I’m not missing something. I would like to avoid the conversion to FP32 and then convert back to FP16.
The compile error:
/usr/local/cuda/include/texture_indirect_functions.h(262): error: no instance of overloaded function “tex2D” matches the argument list
argument types are: (half2 *, cudaTextureObject_t, float, float)
instantiation of “T tex2D(cudaTextureObject_t, float, float) [with T=half2]”