Hard
First GPU access to a managed allocation the host just initialized
data is allocated with cudaMallocManaged. The host initializes every element (touching and thus resident-migrating all pages to host DRAM), then launches kernel<<<...>>>(data) with no explicit prefetch. What happens on the kernel's very first access to data?
kernel.cu
float* data;
cudaMallocManaged(&data, N * sizeof(float));
for (int i = 0; i < N; ++i) data[i] = (float)i; // host touches every page
kernel<<<blocks, threads>>>(data, N); // no cudaMemPrefetchAsync first
cudaDeviceSynchronize();18 of 46 in GPU / CUDA