Page 1 of 1

GPU MAGMA: When to use pinned memory allocation

Posted: Sun Apr 12, 2015 11:35 pm
by wirawan0
Hi,

I am a newbie with GPU & MAGMA programming. I see that MAGMA (and Cuda) provide pinned host memory allocation (magma_*alloc_pinned & cudaMallocHost). When do I need to use pinned malloc instead of regular malloc? I cannot see any indication in the MAGMA documentation or a pattern I could recognize in the testing directory. My understanding is that pinned malloc allows for the best memory transfer speed between GPU and CPU. Is this correct?

Wirawan

Re: GPU MAGMA: When to use pinned memory allocation

Posted: Tue Apr 14, 2015 12:40 am
by mgates3
Yes, pinned memory allows for overlapping CPU work with data transfers, which makes the algorithms faster.

Generally, the testers allocate pinned memory for calling MAGMA functions, while memory that is used only for LAPACK functions doesn't need to be pinned. However, allocating pinned memory can be somewhat expensive, especially for large allocations, so you may want to test with and without pinning to see the performance difference.

-mark