I am working on interpolating a multi-modality image.
The image itself is 3D with 3 channels. Since tex3D doesn’t seem to have a float3 version so
I use float4.
I managed to load the image into a 1D linear float4 array (in typical row major order).
But then I am confused on how to load the float4 array into a 3D cuda array for texture.
My code now looks like
// Load data
loadImage(“path/to/image”, image, extent);
// Allocate cuda array memory
cudaChannelFormatDesc channelDesc =
cudaCreateChannelDesc(32, 32, 32, 32, cudaChannelFormatKindFloat);
// TODO: how to load image into the cuda array?