what is the minimal bits of data type in texture?

Since texture needs cache to accelerate data fetching speed, it seems that we can use short for texture data type. However, even short type is 16bits. whether is it possible to use shorter data type, like char even 2 or 4 bits.

Thanks a lot.

In general, one byte is the smallest addressable unit of storage, and you can have byte-sized texels. See for example here: [url]setting up a CUDA 2D "unsigned char" texture for linear interpolation - Stack Overflow.

thank you very much for your response!

It should work for texture object?

I haven’t used a texture object with byte-sized texels, but given that plain old texture references work with them, I would be very surprised if it doesn’t work with texture objects.

Thanks, njuffa!

If I use cudaMalloc3Darray to malloc memory, do i have alignment problem with unsigned char?

In texture object method,

I should set
cudaResourceDesc.readMode is cudaReadModeElementType?

cudaChannelFormatDesc.x is 8
.f is cudaChannelFormatKindUnsigned?