[OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work
authorShilei Tian <i@tianshilei.me>
Tue, 28 Jun 2022 19:31:41 +0000 (15:31 -0400)
committerShilei Tian <i@tianshilei.me>
Tue, 28 Jun 2022 19:32:03 +0000 (15:32 -0400)
commit2695e23ad96ba2e6417cae89eb51f2b6ba5b7666
treeca41b0764149cc4f5c6bbc6bac369bb77dc276af
parentfd26d86f5f662f71337e4ce266f122564e25466d
[OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work

This patch fixes the issue that P2P memcpy doesn't work. The root cause is we didn't set current context when calling the API function. In addition, a matrix to track the states of each pair of devices is also added such that we only need to query and configure the device once.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D122764
openmp/libomptarget/plugins/cuda/src/rtl.cpp