[Openmp-commits] [PATCH] D135037: [OpenMP] Eliminate the ThreadStates array in favor of indirection
Johannes Doerfert via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Oct 4 06:23:29 PDT 2022
jdoerfert 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)
----------------
jdoerfert wrote:
> tianshilei1992 wrote:
> > Does it work if we just have `ThreadStateTy *ThreadStates`?
> We could, yes. Requires to rewrite the code more :(
Not without rewriting a lot. We use the pointer to build a list of nested thread states. Otherwise we would need to set it up to build the list and have the head in the outermost array, or traverse the list on a lookup, neither seems worth it now.
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