/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir { /// An in parallel op is an op with a region. /// /// This is useful as a terminator to parallel operations that iterate over /// some set and return tensors while avoiding tight coupling between the /// iterating op, the combining op and the individual subtensor producing ops. class InParallelOpInterface; } // namespace mlir namespace mlir { /// A parallel combining op is an operation that models parallel contributions /// to result tensors within the context of a parent iterating operation. /// /// This interface is designed for operations that need to coordinate parallel /// insertions or contributions to tensors that are being constructed across /// multiple parallel iterations. The destination refers to a tensor value that /// is assembled by aggregating results from parallel computations; each /// parallel iteration may contribute a slice, element, or region to the final /// result. No in-place mutation of tensors is implied. /// /// One significant use case for this interface is `tensor.parallel_insert_slice` /// which allows parallel insertion of slices that are aggregated into a /// destination tensor. With this interface, other operations that express /// similar parallel contributions can also be defined. /// /// This op works within an op implementing the `InParallelOpInterface` that /// specifies how the parallel results are combined. /// /// Key semantics: /// - The operation identifies destination tensors to which iterations /// contribute through the `getUpdatedDestinations` method /// - Each parallel iteration may produce elements or regions that are /// incorporated into the destination tensor /// - The parent iterating operation manages the coordination and ensures /// proper synchronization of these contributions /// /// Note: This interface does not verify itself, it is up to the implementing operation /// to verify the correctness of the op. class ParallelCombiningOpInterface; } // namespace mlir namespace mlir { /// An in parallel op is an op with a region. /// /// This is useful as a terminator to parallel operations that iterate over /// some set and return tensors while avoiding tight coupling between the /// iterating op, the combining op and the individual subtensor producing ops. namespace detail { struct InParallelOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::OpResult (*getParentResult)(const Concept *impl, ::mlir::Operation *, int64_t); ::llvm::iterator_range (*getYieldingOps)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::InParallelOpInterface; Model() : Concept{getParentResult, getYieldingOps} {} static inline ::mlir::OpResult getParentResult(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, int64_t idx); static inline ::llvm::iterator_range getYieldingOps(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::InParallelOpInterface; FallbackModel() : Concept{getParentResult, getYieldingOps} {} static inline ::mlir::OpResult getParentResult(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, int64_t idx); static inline ::llvm::iterator_range getYieldingOps(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct InParallelOpInterfaceTrait; } // namespace detail class InParallelOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::InParallelOpInterfaceTrait {}; /// Return `idx`^th result of the parent operation. ::mlir::OpResult getParentResult(int64_t idx); /// Return the contained ops that yield subvalues that this op combines to /// yield to its parent. ::llvm::iterator_range getYieldingOps(); }; } // namespace mlir namespace mlir { /// A parallel combining op is an operation that models parallel contributions /// to result tensors within the context of a parent iterating operation. /// /// This interface is designed for operations that need to coordinate parallel /// insertions or contributions to tensors that are being constructed across /// multiple parallel iterations. The destination refers to a tensor value that /// is assembled by aggregating results from parallel computations; each /// parallel iteration may contribute a slice, element, or region to the final /// result. No in-place mutation of tensors is implied. /// /// One significant use case for this interface is `tensor.parallel_insert_slice` /// which allows parallel insertion of slices that are aggregated into a /// destination tensor. With this interface, other operations that express /// similar parallel contributions can also be defined. /// /// This op works within an op implementing the `InParallelOpInterface` that /// specifies how the parallel results are combined. /// /// Key semantics: /// - The operation identifies destination tensors to which iterations /// contribute through the `getUpdatedDestinations` method /// - Each parallel iteration may produce elements or regions that are /// incorporated into the destination tensor /// - The parent iterating operation manages the coordination and ensures /// proper synchronization of these contributions /// /// Note: This interface does not verify itself, it is up to the implementing operation /// to verify the correctness of the op. namespace detail { struct ParallelCombiningOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::MutableOperandRange (*getUpdatedDestinations)(const Concept *impl, ::mlir::Operation *); ::mlir::Operation*(*getIteratingParent)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::ParallelCombiningOpInterface; Model() : Concept{getUpdatedDestinations, getIteratingParent} {} static inline ::mlir::MutableOperandRange getUpdatedDestinations(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline ::mlir::Operation*getIteratingParent(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::ParallelCombiningOpInterface; FallbackModel() : Concept{getUpdatedDestinations, getIteratingParent} {} static inline ::mlir::MutableOperandRange getUpdatedDestinations(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline ::mlir::Operation*getIteratingParent(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct ParallelCombiningOpInterfaceTrait; } // namespace detail class ParallelCombiningOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ParallelCombiningOpInterfaceTrait {}; /// Returns the list of destination values this op contributes to. ::mlir::MutableOperandRange getUpdatedDestinations(); /// Returns the iterating parent for this op. ::mlir::Operation*getIteratingParent(); }; } // namespace mlir namespace mlir::detail { template struct InParallelOpInterfaceTrait : public ::mlir::OpInterface::Trait { static ::llvm::LogicalResult verifyTrait(::mlir::Operation *op) { return verifyInParallelOpInterface(op); } }; } // namespace mlir::detail namespace mlir::detail { template struct ParallelCombiningOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::detail namespace mlir { template ::mlir::OpResult detail::InParallelOpInterfaceInterfaceTraits::Model::getParentResult(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, int64_t idx) { return (llvm::cast(tablegen_opaque_val)).getParentResult(idx); } template ::llvm::iterator_range detail::InParallelOpInterfaceInterfaceTraits::Model::getYieldingOps(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getYieldingOps(); } template ::mlir::OpResult detail::InParallelOpInterfaceInterfaceTraits::FallbackModel::getParentResult(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, int64_t idx) { return static_cast(impl)->getParentResult(tablegen_opaque_val, idx); } template ::llvm::iterator_range detail::InParallelOpInterfaceInterfaceTraits::FallbackModel::getYieldingOps(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getYieldingOps(tablegen_opaque_val); } } // namespace mlir namespace mlir { template ::mlir::MutableOperandRange detail::ParallelCombiningOpInterfaceInterfaceTraits::Model::getUpdatedDestinations(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getUpdatedDestinations(); } template ::mlir::Operation*detail::ParallelCombiningOpInterfaceInterfaceTraits::Model::getIteratingParent(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getIteratingParent(); } template ::mlir::MutableOperandRange detail::ParallelCombiningOpInterfaceInterfaceTraits::FallbackModel::getUpdatedDestinations(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getUpdatedDestinations(tablegen_opaque_val); } template ::mlir::Operation*detail::ParallelCombiningOpInterfaceInterfaceTraits::FallbackModel::getIteratingParent(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getIteratingParent(tablegen_opaque_val); } } // namespace mlir