/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::spirv { /// The `SampleOpInterface` defines sampling image operations (`spirv.Image*Sample*`) /// and provides interface methods to query operands common across all sampling /// instructions. /// /// Currently only getters for sampled image and coordinate are provided. The /// default implementation will work as long as the instruction the interface is /// attached to uses standard names for the operands: `$sampled_image` and `$coordinate`. class SamplingOpInterface; } // namespace mlir::spirv namespace mlir::spirv { /// The `ExplicitLodOpInterface` defines explicit sampling lod operations (`spirv.*ExplicitLod`). Currently /// the interface is only used to check whether the instruction is an explicit lod. class ExplicitLodOpInterface; } // namespace mlir::spirv namespace mlir::spirv { /// The `ImplicitLodOpInterface` defines implicit sampling lod operations (`spirv.*ImplicitLod`). Currently /// the interface is only used to check whether the instruction is an implicit lod. class ImplicitLodOpInterface; } // namespace mlir::spirv namespace mlir::spirv { /// The `FetchOpInterface` defines fetch image operations (`spirv.ImageFetch` and /// `spirv.ImageSpareFetch`) and provides interface methods to query operands common /// across all fetch instructions. /// /// Currently only a getter for image is provided. The default implementation /// will work as long as the instruction the interface is attached to uses /// standard names for the operands: `$image`. class FetchOpInterface; } // namespace mlir::spirv namespace mlir::spirv { /// The `SampleOpInterface` defines sampling image operations (`spirv.Image*Sample*`) /// and provides interface methods to query operands common across all sampling /// instructions. /// /// Currently only getters for sampled image and coordinate are provided. The /// default implementation will work as long as the instruction the interface is /// attached to uses standard names for the operands: `$sampled_image` and `$coordinate`. namespace detail { struct SamplingOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::TypedValue<::mlir::Type> (*getSampledImage)(const Concept *impl, ::mlir::Operation *); ::mlir::TypedValue<::mlir::Type> (*getCoordinate)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::spirv::SamplingOpInterface; Model() : Concept{getSampledImage, getCoordinate} {} static inline ::mlir::TypedValue<::mlir::Type> getSampledImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline ::mlir::TypedValue<::mlir::Type> getCoordinate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::spirv::SamplingOpInterface; FallbackModel() : Concept{getSampledImage, getCoordinate} {} static inline ::mlir::TypedValue<::mlir::Type> getSampledImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline ::mlir::TypedValue<::mlir::Type> getCoordinate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct SamplingOpInterfaceTrait; } // namespace detail class SamplingOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::SamplingOpInterfaceTrait {}; /// Get SampledImage of the operation. ::mlir::TypedValue<::mlir::Type> getSampledImage(); /// Get Coordinate of the operation. ::mlir::TypedValue<::mlir::Type> getCoordinate(); }; } // namespace mlir::spirv namespace mlir::spirv { /// The `ExplicitLodOpInterface` defines explicit sampling lod operations (`spirv.*ExplicitLod`). Currently /// the interface is only used to check whether the instruction is an explicit lod. namespace detail { struct ExplicitLodOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. /// The base classes of this interface. const ::mlir::spirv::SamplingOpInterface::Concept *implSamplingOpInterface = nullptr; void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) { implSamplingOpInterface = interfaceMap.lookup<::mlir::spirv::SamplingOpInterface>(); assert(implSamplingOpInterface && "`::mlir::spirv::ExplicitLodOpInterface` expected its base interface `::mlir::spirv::SamplingOpInterface` to be registered"); } }; template class Model : public Concept { public: using Interface = ::mlir::spirv::ExplicitLodOpInterface; Model() : Concept{} {} }; template class FallbackModel : public Concept { public: using Interface = ::mlir::spirv::ExplicitLodOpInterface; FallbackModel() : Concept{} {} }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct ExplicitLodOpInterfaceTrait; } // namespace detail class ExplicitLodOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ExplicitLodOpInterfaceTrait {}; //===----------------------------------------------------------------===// // Inherited from ::mlir::spirv::SamplingOpInterface //===----------------------------------------------------------------===// operator ::mlir::spirv::SamplingOpInterface () const { if (!*this) return nullptr; return ::mlir::spirv::SamplingOpInterface(*this, getImpl()->implSamplingOpInterface); } /// Get SampledImage of the operation. ::mlir::TypedValue<::mlir::Type> getSampledImage(); /// Get Coordinate of the operation. ::mlir::TypedValue<::mlir::Type> getCoordinate(); }; } // namespace mlir::spirv namespace mlir::spirv { /// The `ImplicitLodOpInterface` defines implicit sampling lod operations (`spirv.*ImplicitLod`). Currently /// the interface is only used to check whether the instruction is an implicit lod. namespace detail { struct ImplicitLodOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. /// The base classes of this interface. const ::mlir::spirv::SamplingOpInterface::Concept *implSamplingOpInterface = nullptr; void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) { implSamplingOpInterface = interfaceMap.lookup<::mlir::spirv::SamplingOpInterface>(); assert(implSamplingOpInterface && "`::mlir::spirv::ImplicitLodOpInterface` expected its base interface `::mlir::spirv::SamplingOpInterface` to be registered"); } }; template class Model : public Concept { public: using Interface = ::mlir::spirv::ImplicitLodOpInterface; Model() : Concept{} {} }; template class FallbackModel : public Concept { public: using Interface = ::mlir::spirv::ImplicitLodOpInterface; FallbackModel() : Concept{} {} }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct ImplicitLodOpInterfaceTrait; } // namespace detail class ImplicitLodOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ImplicitLodOpInterfaceTrait {}; //===----------------------------------------------------------------===// // Inherited from ::mlir::spirv::SamplingOpInterface //===----------------------------------------------------------------===// operator ::mlir::spirv::SamplingOpInterface () const { if (!*this) return nullptr; return ::mlir::spirv::SamplingOpInterface(*this, getImpl()->implSamplingOpInterface); } /// Get SampledImage of the operation. ::mlir::TypedValue<::mlir::Type> getSampledImage(); /// Get Coordinate of the operation. ::mlir::TypedValue<::mlir::Type> getCoordinate(); }; } // namespace mlir::spirv namespace mlir::spirv { /// The `FetchOpInterface` defines fetch image operations (`spirv.ImageFetch` and /// `spirv.ImageSpareFetch`) and provides interface methods to query operands common /// across all fetch instructions. /// /// Currently only a getter for image is provided. The default implementation /// will work as long as the instruction the interface is attached to uses /// standard names for the operands: `$image`. namespace detail { struct FetchOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::TypedValue<::mlir::Type> (*getImage)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::spirv::FetchOpInterface; Model() : Concept{getImage} {} static inline ::mlir::TypedValue<::mlir::Type> getImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::spirv::FetchOpInterface; FallbackModel() : Concept{getImage} {} static inline ::mlir::TypedValue<::mlir::Type> getImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct FetchOpInterfaceTrait; } // namespace detail class FetchOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::FetchOpInterfaceTrait {}; /// Get Image of the operation. ::mlir::TypedValue<::mlir::Type> getImage(); }; } // namespace mlir::spirv namespace mlir::spirv::detail { template struct SamplingOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::spirv::detail namespace mlir::spirv::detail { template struct ExplicitLodOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::spirv::detail namespace mlir::spirv::detail { template struct ImplicitLodOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::spirv::detail namespace mlir::spirv::detail { template struct FetchOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::spirv::detail namespace mlir::spirv { template ::mlir::TypedValue<::mlir::Type> detail::SamplingOpInterfaceInterfaceTraits::Model::getSampledImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getSampledImage(); } template ::mlir::TypedValue<::mlir::Type> detail::SamplingOpInterfaceInterfaceTraits::Model::getCoordinate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getCoordinate(); } template ::mlir::TypedValue<::mlir::Type> detail::SamplingOpInterfaceInterfaceTraits::FallbackModel::getSampledImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getSampledImage(tablegen_opaque_val); } template ::mlir::TypedValue<::mlir::Type> detail::SamplingOpInterfaceInterfaceTraits::FallbackModel::getCoordinate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getCoordinate(tablegen_opaque_val); } } // namespace mlir::spirv namespace mlir::spirv { } // namespace mlir::spirv namespace mlir::spirv { } // namespace mlir::spirv namespace mlir::spirv { template ::mlir::TypedValue<::mlir::Type> detail::FetchOpInterfaceInterfaceTraits::Model::getImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getImage(); } template ::mlir::TypedValue<::mlir::Type> detail::FetchOpInterfaceInterfaceTraits::FallbackModel::getImage(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getImage(tablegen_opaque_val); } } // namespace mlir::spirv