mapped memory and streams


I read it’s required to use page locked memory for streams. Is it possible to use “mapped” memory, too (it’s page locked memory, too)?


I’m not sure, but:
Streams are used to tell the CPU the sequence of asynchronous memory copies and kernel calls. When you allocated pinned host memory which is mapped to GPU memory, you don’t do explicit memory copying on host, so the stream is not needed.

Thank you for this reply.

Yes, you are right! What do you think is more efficient. Using streams or using mapped memory?

They’re different, and one can’t be said to strictly perform better than the other (otherwise we wouldn’t support both). However, you can do a cudaMemcpyAsync with a mapped buffer.