Initial step to add pinned memory support on GPU
- Add new APIs
PetscMallocSetCUDAHost()
andPetscMallocResetCUDAHost()
to make use of pinned memory - Use pinned memory for petsc vector automatically when its size exceeds the threshold (default to 128 MB).
- A simple test that shows the performance advantage of using pinned memory ./src/vec/vec/examples/tutorials/ex1 -log_view -n 100000000 -vec_type cuda With pinned memory on host: 0.425 sec With standard memory on host: 0.485 sec
@rtmills and @hannah_mairs also have done some experiments that favor using pinned memory for large data.