@@ -636,6 +636,57 @@ def YieldOp : OpenMP_Op<"yield",
636
636
let assemblyFormat = [{ ( `(` $results^ `:` type($results) `)` )? attr-dict}];
637
637
}
638
638
639
+ //===----------------------------------------------------------------------===//
640
+ // Distribute construct [2.9.4.1]
641
+ //===----------------------------------------------------------------------===//
642
+ def DistributeOp : OpenMP_Op<"distribute", [AttrSizedOperandSegments,
643
+ RecursiveMemoryEffects]> {
644
+ let summary = "distribute construct";
645
+ let description = [{
646
+ The distribute construct specifies that the iterations of one or more loop
647
+ will be executed by the initial teams in the context of their implicit
648
+ tasks. The iterations are distributed across the initial threads of all
649
+ initial teams that execute the teams region to which the distribute region
650
+ binds.
651
+
652
+ The distribute loop construct specifies that the iterations of the loop(s)
653
+ will be executed in parallel by threads in the current context. These
654
+ iterations are spread across threads that already exist in the enclosing
655
+ region. The lower and upper bounds specify a half-open range: the
656
+ range includes the lower bound but does not include the upper bound. If the
657
+ `inclusive` attribute is specified then the upper bound is also included.
658
+
659
+ The `dist_schedule_static` attribute specifies the schedule for this
660
+ loop, determining how the loop is distributed across the parallel threads.
661
+ The optional `schedule_chunk` associated with this determines further
662
+ controls this distribution.
663
+
664
+ // TODO: private_var, firstprivate_var, lastprivate_var, collapse
665
+ }];
666
+ let arguments = (ins
667
+ UnitAttr:$dist_schedule_static,
668
+ Optional<IntLikeType>:$chunk_size,
669
+ Variadic<AnyType>:$allocate_vars,
670
+ Variadic<AnyType>:$allocators_vars,
671
+ OptionalAttr<OrderKindAttr>:$order_val);
672
+
673
+ let regions = (region AnyRegion:$region);
674
+
675
+ let assemblyFormat = [{
676
+ oilist(`dist_schedule_static` $dist_schedule_static
677
+ |`chunk_size` `(` $chunk_size `:` type($chunk_size) `)`
678
+ |`order` `(` custom<ClauseAttr>($order_val) `)`
679
+ |`allocate` `(`
680
+ custom<AllocateAndAllocator>(
681
+ $allocate_vars, type($allocate_vars),
682
+ $allocators_vars, type($allocators_vars)
683
+ ) `)`
684
+ ) $region attr-dict
685
+ }];
686
+
687
+ let hasVerifier = 1;
688
+ }
689
+
639
690
//===----------------------------------------------------------------------===//
640
691
// 2.10.1 task Construct
641
692
//===----------------------------------------------------------------------===//
0 commit comments