llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[OpenMP] Tracking issue for multidimensional leagues and teams

Open kevinsala opened this issue 3 months ago • 4 comments

This issue is dedicated to tracking the implementation of multidimensional leagues and teams for OpenMP 6.1 in Clang and Flang. This feature allows num_teams, thread_limit and num_threads to specify multidimensional execution spaces via the dims complex modifier.

For more information, see "OpenMP Technical Report 15: Version 6.1 Public Comment Draft" (July 2026) in https://www.openmp.org/specifications/.

kevinsala avatar Aug 25 '26 20:08 kevinsala

@llvm/issue-subscribers-openmp

Author: Kevin Sala Penades (kevinsala)

This issue is dedicated to tracking the implementation of multidimensional leagues and teams for OpenMP 6.1 in Clang and Flang. This feature allows `num_teams`, `thread_limit` and `num_threads` to specify multidimensional execution spaces via the `dims` complex modifier.

For more information, see "OpenMP Technical Report 15: Version 6.1 Public Comment Draft" (July 2026) in https://www.openmp.org/specifications/.

@llvm/issue-subscribers-offload

Author: Kevin Sala Penades (kevinsala)

This issue is dedicated to tracking the implementation of multidimensional leagues and teams for OpenMP 6.1 in Clang and Flang. This feature allows `num_teams`, `thread_limit` and `num_threads` to specify multidimensional execution spaces via the `dims` complex modifier.

For more information, see "OpenMP Technical Report 15: Version 6.1 Public Comment Draft" (July 2026) in https://www.openmp.org/specifications/.

  • Clang:
    • #205700
    • #207305
    • #206412
    • #208353
    • #218589
    • #239860
  • LLVM: WIP @kevinsala
    • #211453
  • Offload and plugins: WIP @kevinsala
    • #199483
    • #211400
  • OpenMP device runtime: WIP @kevinsala
  • MLIR:
    • #179418
    • #179420
    • #179608

kevinsala avatar Aug 25 '26 22:08 kevinsala

Hi @kevinsala

The MLIR lowering PRs (#179418, #179420, #179608) now collect every dimension of num_teams, thread_limit and num_threads into the vectorized TargetKernelDefaultAttrs and TargetKernelRuntimeAttrs from #211453.

On upstream llvm-project main, though, the OpenMPIRBuilder still reads only .front(), so dimensions 1 and 2 are dropped. That's the concern @skatrak raised on #179420 and #179608.

Compared to fork https://github.com/kevinsala/llvm-project-fork/tree/kernel-lang-develop I found below changes that could be added to upstream llvm main in OmpIRBuilder module:

  • writeThreadBoundsForKernel / writeTeamsForKernel taking all dimensions.
  • createTargetInit handling for multi-dim kernels.

Could you please port these changes aswell to upstream main.

CC: @skatrak

skc7 avatar Oct 07 '26 06:10 skc7