NiftyPET / NIPET

High-throughput PET image reconstruction with high quantitative accuracy and precision
Apache License 2.0
29 stars 7 forks source link

Managed memory on /src/norm.cu #16

Open AnderBiguri opened 4 years ago

AnderBiguri commented 4 years ago

Hi! I am just checking around the CUDA code to understand few things, and when looking at the code for the normalization, I found several instances of the following:

https://github.com/NiftyPET/NIPET/blob/master/niftypet/nipet/src/norm.cu#L94-L98

It looks like you are allocating managed memory if its not a windows 32 OS. I have some questions about why this is done:

  1. Managed memory will behave differently in pre and post 6.x cc, so you may get different performance, "in the general case"

  2. This code does not seem to need managed memory (if I am not wrong, please correct me!). You allocate an array on GPU and use it on the kernel, then free it. Managed memory will likely cause just slower execution. Why are you using it? Is it maybe because you are worried of running out of RAM, and it may help in the cc>6.0 archs ?