I would like to acces a 2D texture in cuda using filtering. This texture uses ‘unsigned ints’ because I need atomic operations. Now when I use the following:
So I want filtered acces and return a float. This gives me the error that “linear filtering is not supported for non-float type”. Now when I normalise the return value, like so:
no instance of overloaded function “tex2D” matches the argument list. argument types are: (texture<unsigned int, 2, cudaReadModeNormalizedFloat>, float, float)
Does anyone has more insight into this problem or can you point me to relevant information? I can’t seem to find why the tex2D function can’t use a texture with <uint,…,readModeNormFloat>
It seems that using filtering with a 32bit uint is not possible (although I didn’t find any info on this). So using a ushort would solve the filtering problem (same for using float). But then I can’t use atomic operations (need a 32 or 64 bit uint)… There is no way around this I suppose?
It seems that using filtering with a 32bit uint is not possible (although I didn’t find any info on this). So using a ushort would solve the filtering problem (same for using float). But then I can’t use atomic operations (need a 32 or 64 bit uint)… There is no way around this I suppose?
confirming that you can only use cudaReadModeNormalizedFloat with 16 and 8 bit integer types.
You could always use cudaReadModeElementType and perform the filtering “by hand” in software. You likely won’t see a performance degradation (I didn’t when I did this) and you get a full-precision filter to boot (cudaFilterModeLinear only has 255 steps from one value to the next)
confirming that you can only use cudaReadModeNormalizedFloat with 16 and 8 bit integer types.
You could always use cudaReadModeElementType and perform the filtering “by hand” in software. You likely won’t see a performance degradation (I didn’t when I did this) and you get a full-precision filter to boot (cudaFilterModeLinear only has 255 steps from one value to the next)