sharing device memory between two or more streams


If I use cudaMalloc to allocate some device memory, is it valid to share that chunk of device memory amongst two or more cuda streams running in parallel, assuming that each stream only reads from this memory and never attempts to write at it?


Perfectly fine.