CERN/TIGRE

Make pinned/page-locked memory optional

AnderBiguri opened this issue · 2 comments

This would slow the proj/backproj, but will allow people to use swap memory.

This can be done "easily" at Compile time.
We can have a user flag (task 1: allow user flags easily into Compile.m) that is then passed to the CUDA code similar to IS_FOR_MATLAB_TIGRE, and is used in the following if condition (each file has one):

if (isHostRegisterSupported & (splits>1 |deviceCount>1)){
cudaHostRegister(img, (size_t)geo.nVoxelX*(size_t)geo.nVoxelY*(size_t)geo.nVoxelZ*(size_t)sizeof(float),cudaHostRegisterPortable);
}
cudaCheckErrors("Error pinning memory");

The flag could be ENABLE_PINNED_MEMORY which can be set to TRUE by default.

This also needs to be used in the part where the memory is "unpinned", in the end of the main function.