How about this?
Create two texture references:
texture<unsigned char, 3, cudaReadModeElementType> volumeTexture_char;
texture<unsigned short, 3, cudaReadModeElementType> volumeTexture_short;
Then, dynamically bind to the one you need in host code:
if (...) {
cudaBindTexture(0, volumeTexture_char, ...);
}
else {
cudaBindTexture(0, volumeTexture_short, ...);
}
Then, pass in a flag on which one to use in the kernel::
my_kernel<<...>>(use_short, ...);