File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
mlir/include/mlir/Dialect/OpenMP Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,41 @@ def SectionsOp : OpenMP_Op<"sections", traits = [
325
325
let hasRegionVerifier = 1;
326
326
}
327
327
328
+ //===----------------------------------------------------------------------===//
329
+ // Coexecute Construct
330
+ //===----------------------------------------------------------------------===//
331
+
332
+ def CoexecuteOp : OpenMP_Op<"coexecute"> {
333
+ let summary = "coexecute directive";
334
+ let description = [{
335
+ The coexecute construct specifies that the teams from the teams directive
336
+ this is nested in shall cooperate to execute the computation in this region.
337
+ There is no implicit barrier at the end as specified in the standard.
338
+
339
+ TODO
340
+ We should probably change the defaut behaviour to have a barrier unless
341
+ nowait is specified, see below snippet.
342
+
343
+ ```
344
+ !$omp target teams
345
+ !$omp coexecute
346
+ tmp = matmul(x, y)
347
+ !$omp end coexecute
348
+ a = tmp(0, 0) ! there is no implicit barrier! the matmul hasnt completed!
349
+ !$omp end target teams coexecute
350
+ ```
351
+
352
+ }];
353
+
354
+ let arguments = (ins UnitAttr:$nowait);
355
+
356
+ let regions = (region AnyRegion:$region);
357
+
358
+ let assemblyFormat = [{
359
+ oilist(`nowait` $nowait) $region attr-dict
360
+ }];
361
+ }
362
+
328
363
//===----------------------------------------------------------------------===//
329
364
// 2.8.2 Single Construct
330
365
//===----------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments