Modifying the contents of an texture array on the fly

I want to periodically change the contents of the cuda array, to which I have a link to the texture in the device code. Note that updating the array must be done in the main code. My question is: can we do this at the same time, that is, the device core should be called only once, and the contents of the array change periodically and are reflected in the device’s memory.

+4
source share
1 answer

If you modify cudaArray from the host, the changes are not guaranteed to be reflected in texture memory. Because the texture is cached. While you are modifying cudaArray on the host, you do not know how much of this memory is cached by text and which is not.

The only guarantee that changes are fully reflected in the device code is when the kernel has finished executing.

+4
source

Source: https://habr.com/ru/post/1433715/


All Articles