nicebert wrote:

> I've forgotten about a lot of this stuff, but wasn't the issue that OpenMP 
> thread counts can be changed via environment variables or something? OR 
> something like saying you want `N` threads just means OpenMP gives you 'up to 
> N' threads, I forget.

It's gated on -fopenmp-assume-teams-oversubscription and 
-fopenmp-assume-threads-oversubscription, so it only applies when the user has 
asserted the launch can be sized to the iteration space. Clang doesn't compute 
any counts, it sets the exec mode and the runtime sizes the launch.

> The problem with doing this in the frontend is that there's a very narrow 
> definition for what SPMD is because the compiler has no concept of IPO. I'm 
> wondering if instead we could attach these options as metadata to the 
> generated kernel and handle it in OpenMPOpt.

This doesn't change how SPMD is decided, it only refines a kernel that is 
already SPMD, and moving that refinement into OpenMPOpt would end up different 
from flang, which makes the decision before LLVM IR so the loop is never 
emitted. Doing it later would mean deleting an existing loop, and the clause 
information isn't in the IR anymore.

https://github.com/llvm/llvm-project/pull/205325
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to