From 14de0820e87f552993cf9b2c5c31f67e12fb0644 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Tue, 8 Mar 2022 23:45:43 -0600 Subject: [PATCH] [OpenMP][FIX] Ensure the modules vector is filled as others are The modules vector was for some reason special which could lead to it not being of the same size (=num devices). Easiest solution is to treat it like we do all the other vectors. --- openmp/libomptarget/plugins/cuda/src/rtl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp index bbffc47..dab5b52 100644 --- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -533,6 +533,7 @@ public: } DeviceData.resize(NumberOfDevices); + Modules.resize(NumberOfDevices); StreamPool.resize(NumberOfDevices); EventPool.resize(NumberOfDevices); @@ -817,7 +818,7 @@ public: DP("CUDA module successfully loaded!\n"); - Modules.push_back(Module); + Modules[DeviceId] = Module; // Find the symbols in the module by name. const __tgt_offload_entry *HostBegin = Image->EntriesBegin; -- 2.7.4