This question pops up in my mind everytime I use pinned memory in CUDA. I have already searched a lot on this topic but didnt find anything. Basically we have to perform two data transfers in order to use pinned memory:
Step1 -> Pageable memory to pinned memory
Step2 -> Pinned memory to device memory
I can also directly initialize the pinned memory by the input data and transfer it to the GPU, it will save my transfer time of Step1. In my case I am processing very large amount of input data on GPU. And too much page locked memory could decrease your overall system performance. So I cannot just make the whole allocation on pinned memory. I have to iteratively make transfers of Step1 and Step2 (above).
Is there any provision in CUDA to convert your existing host memory(pageable) into pinned memory? Like follows :
Step 1 -> Initialize the pageable memory by input data
Step 2 -> Convert the above memory to Pinned memory
Step 3 -> Transfer to device and perform execution
I hope what I am asking make sense.