[Openmp-commits] [PATCH] D135037: [OpenMP] Eliminate the ThreadStates array in favor of indirection

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 3 09:16:15 PDT 2022


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/DeviceRTL/include/State.h:112
 
-extern ThreadStateTy *ThreadStates[mapping::MaxThreadsPerTeam];
+extern ThreadStateTy **ThreadStates;
 #pragma omp allocate(ThreadStates) allocator(omp_pteam_mem_alloc)
----------------
Does it work if we just have `ThreadStateTy *ThreadStates`?


================
Comment at: openmp/libomptarget/DeviceRTL/src/State.cpp:269
+                     atomic::seq_cst, atomic::seq_cst))
+      memory::freeGlobal(ThreadStatesPtr,
+                         "Thread state array allocated multiple times");
----------------
Is it a valid state when it reaches to this point? If not, I think it'd better to have an assertion here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135037/new/

https://reviews.llvm.org/D135037



More information about the Openmp-commits mailing list