Reputation: 13614
Suppose that I have send two consecutive kernel calls to the device. Does it wait to complete the first one or it executed them concurrently? If they are executed in parallel, do they intersect with each other for instance for memory access? What is the paradigm that is used for such case in CUDA?
Upvotes: 1
Views: 862
Reputation: 27809
Two consecutive kernel launches to the same CUDA device will run concurrently if:
For more information, see this section in the CUDA C Programming Guide.
As sgar91 commented, if these kernels share global memory, then it is the programmer's responsibility to write a correctly synchronized program to avoid race conditions. If the two kernels only read the same memory, then there can be no race condition.
Upvotes: 3