0Pricing
CUDA Academy · Lesson

Prefetching with cudaMemPrefetchAsync

Moving pages before they are needed.

Stop Paying for Faults

Instead of waiting for slow first-touch faults, you can move pages early. cudaMemPrefetchAsync sends managed data to a device before the kernel needs it.

The Basic Call

You name the pointer, the byte count, and the destination device. This one prefetch migrates the whole range up front in a single efficient move.

cudaMemPrefetchAsync(data, n * sizeof(float), 0);

All lessons in this course

  1. One Pointer, Both Sides
  2. On-Demand Page Migration
  3. Prefetching with cudaMemPrefetchAsync
  4. Hints via cudaMemAdvise
← Back to CUDA Academy