[Rtk-users] CUDA 3D texture memory management

Simon Rit simon.rit at creatis.insa-lyon.fr
Fri May 24 07:17:40 EDT 2013


Hi Cyril,
We haven't done any example like this in RTK but my guess is that:
- at the beginning, you malloc your memory with cudaMalloc3DArray. I
believe this is standard (but aligned appropriately) global memory
- when you need the texture (for interpolation), you do
cudaBindTextureToArray
run the kernel
cudaUnbindTexture
- when you need to write in the memory, you can use the pointer
provided by cudaMalloc3DArray as any global memory pointer.
Let us know if this does not work,
Simon

On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL <Cyril.Mory at philips.com> wrote:
> Hi everyone,
>
>
>
> I’m converting a filter I’ve designed into CUDA, and I’m new to CUDA. The
> filter takes in input a 4d image (3D +time), interpolates between two
> instants (two 3D images taken from the 4D image by selecting a given
> instant) to obtain a 3D image, and forward projects through this 3D image. I
> already have an interpolation kernel that works, it uses global memory to
> store both the 4D image and the interpolated 3D image (there probably is a
> better way, but I’ll optimize that later). For the forward projection, I’d
> like to reuse as much as possible the rtkCudaForwardProjectionImageFilter
> code, but :
>
> -          rtkCudaForwardProjectionImageFilter stores its input 3D volume
> into a 3D texture
>
> -          texture memory, I think, is read-only for threads
>
> -          So I can’t fill in the 3D texture during interpolation
>
> I think I need to work with global memory during interpolation to generate
> the 3D volume, then somehow copy the result to a 3D texture, and use the
> existing (maybe slightly modified) forward projection function to get the
> projection.
>
>
>
> My problem is in the “somehow”… Do I need to actually copy the data from the
> global memory to the texture memory ? Or is it enough to bind it to a
> texture ? Does anyone have an example somewhere ?
>
>
>
> Regards,
>
> ==========================================
>
> Cyril Mory
>
> PhD student at Philips Medisys and CREATIS
>
>
>
> Groupement Hospitalier Est
>
> Hôpital Cardiologique Louis Pradel
>
> Laboratoire CREATIS - Bât. B13
>
> CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1
>
> 28, Avenue du Doyen LEPINE
>
> 69677 Bron cedex FRANCE
>
>
>
> Office : +33 4 72 35 74 12
>
> Cell : +33 6 69 46 73 79
>
>
>
>
> ________________________________
> The information contained in this message may be confidential and legally
> protected under applicable law. The message is intended solely for the
> addressee(s). If you are not the intended recipient, you are hereby notified
> that any use, forwarding, dissemination, or reproduction of this message is
> strictly prohibited and may be unlawful. If you are not the intended
> recipient, please contact the sender by return e-mail and destroy all copies
> of the original message.
>
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at openrtk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users
>



More information about the Rtk-users mailing list