diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp --- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -89,10 +89,6 @@ int32_t debug_level; }; -/// List that contains all the kernels. -/// FIXME: we may need this to be per device and per library. -std::list KernelsList; - namespace { bool checkResult(CUresult Err, const char *ErrMsg) { if (Err == CUDA_SUCCESS) @@ -121,7 +117,11 @@ // Structure contains per-device data struct DeviceDataTy { + /// List that contains all the kernels. + std::list KernelsList; + std::list FuncGblEntries; + CUcontext Context = nullptr; // Device properties int ThreadsPerBlock = 0; @@ -568,6 +568,7 @@ const __tgt_offload_entry *HostBegin = Image->EntriesBegin; const __tgt_offload_entry *HostEnd = Image->EntriesEnd; + std::list &KernelsList = DeviceData[DeviceId].KernelsList; for (const __tgt_offload_entry *E = HostBegin; E != HostEnd; ++E) { if (!E->addr) { // We return nullptr when something like this happens, the host should