Added the OpenMP Teams Construct operation definition for MLIR.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
100 | From another patch? | |
142 | You might want to align OptionalAttr with the Optional above. I think other operations in this file are like that. | |
299–300 | What's the reason to remove this? | |
325 | From another patch? | |
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp | ||
799 ↗ | (On Diff #357044) | Should not be removed? |
mlir/test/Dialect/OpenMP/ops.mlir | ||
299 | Should not be removed? |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
100 | I think I need to update my repo. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
100 | This is from the previous patch. | |
299–300 | Its accidentally removed because of moving code between branches. I. will fix all these mistakes. | |
325 | yes. It is from another patch. | |
mlir/test/Dialect/OpenMP/ops.mlir | ||
299 | I branched for teams construct. Do we need it for this patch? |
Let me submit it again. Most of the stuff is still on my machine but did not appear or seemed removed.
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp | ||
---|---|---|
799 ↗ | (On Diff #357044) | This is from another patch that is still under review. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
120 | Just a simple question here: I'm not sure we need a 1-to-1 mapping between construct and dialect operation. Did you think through how omp.target and omp.teams operation will interact? |
Here is a simple example of interaction:
func @omp_compute(%x: memref<1024xf32>, %y: memref<1024xf32>, %n: index, %a: f32, %N:i32) -> memref<1024xf32> { %c0 = constant 0 : index %c1 = constant 1 : index %c0 = constant 0 : index %c1 = constant 1 : index omp.target { omp.teams num_teams(2) thread_limit(%N) { omp.distribute{ loop.for %arg0 = %c0 to %n step %c1 { %xi = load %x[%arg0] : memref<1024xf32> %yi = load %y[%arg0] : memref<1024xf32> %ax = mulf %a, %xi : f32 %yy = addf %ax, %yi : f32 store %yy, %y[%arg0] : memref<1024xf32> } } } } return %y : memref<1024xf32> }
@kiranchandramohan
What is the solution to remove this confusionn? This patch does not need the basic parsing patch for target operation. I feel my branching was not correctly done which created this confusion.
You likely did your patch from a branch other than main so you have remaining of the previous patches work.
Apply your patch on a fresh branch from main and fix the problematic diffs
OK
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
120 | Are you asking with respect to the discussion [[ https://lists.llvm.org/pipermail/llvm-dev/2020-February/139136.html | [llvm-dev] About OpenMP dialect in MLIR]]? Here how I see the interaction: omp.target { omp.teams { loop.for{ } } } |
Please just update the NIT comment before proceeding.
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
123 | Please split the line at 80. |
I think this patch can be closed now, since D154441 landed with support for that operation.
From another patch?