标签: gpu-managed-memory

What is the difference between mapped memory and managed memory?

I have been reading about the various approaches to memory management offered by CUDA, and I'm struggling to understand the difference between mapped memory:

int *foo;
std::size_t size = 32;
cudaHostAlloc(&foo, size, cudaHostAllocMapped);
Run Code Online (Sandbox Code Playgroud)

...and managed memory:

int *foo;
std::size_t size = 32;
cudaMallocManaged(&foo, size);
Run Code Online (Sandbox Code Playgroud)

They both appear to implicitly transfer memory between the host and device. cudaMallocManaged seems to be the newer API, and it uses the so-called "Unified Memory" system. That said, cudaHostAlloc seems to share many of these …

cuda nvidia gpu-managed-memory

4
推荐指数
1
解决办法
1850
查看次数

标签 统计

cuda ×1

gpu-managed-memory ×1

nvidia ×1