#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_LEGALIZEDATAINREGION
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_LEGALIZEDATAINREGION
struct LegalizeDataInRegionOptions { … };
#undef GEN_PASS_DECL_LEGALIZEDATAINREGION
#endif
#ifdef GEN_PASS_DEF_LEGALIZEDATAINREGION
namespace impl {
template <typename DerivedT>
class LegalizeDataInRegionBase : public ::mlir::OperationPass<mlir::func::FuncOp> {
public:
using Base = LegalizeDataInRegionBase;
LegalizeDataInRegionBase() : ::mlir::OperationPass<mlir::func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
LegalizeDataInRegionBase(const LegalizeDataInRegionBase &other) : ::mlir::OperationPass<mlir::func::FuncOp>(other) {}
LegalizeDataInRegionBase& operator=(const LegalizeDataInRegionBase &) = delete;
LegalizeDataInRegionBase(LegalizeDataInRegionBase &&) = delete;
LegalizeDataInRegionBase& operator=(LegalizeDataInRegionBase &&) = delete;
~LegalizeDataInRegionBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("openacc-legalize-data");
}
::llvm::StringRef getArgument() const override { return "openacc-legalize-data"; }
::llvm::StringRef getDescription() const override { return "Legalize the data in the compute region"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("LegalizeDataInRegion");
}
::llvm::StringRef getName() const override { return "LegalizeDataInRegion"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(LegalizeDataInRegionBase<DerivedT>)
LegalizeDataInRegionBase(LegalizeDataInRegionOptions options) : LegalizeDataInRegionBase() {
hostToDevice = std::move(options.hostToDevice);
}
protected:
::mlir::Pass::Option<bool> hostToDevice{*this, "host-to-device", ::llvm::cl::desc("Replace varPtr uses with accPtr if true. Replace accPtr uses with varPtr if false"), ::llvm::cl::init(true)};
private:
};
}
#undef GEN_PASS_DEF_LEGALIZEDATAINREGION
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerLegalizeDataInRegion() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return ::mlir::acc::createLegalizeDataInRegion();
});
}
inline void registerLegalizeDataInRegionPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return ::mlir::acc::createLegalizeDataInRegion();
});
}
inline void registerOpenACCPasses() {
registerLegalizeDataInRegion();
}
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class LegalizeDataInRegionBase : public ::mlir::OperationPass<mlir::func::FuncOp> {
public:
using Base = LegalizeDataInRegionBase;
LegalizeDataInRegionBase() : ::mlir::OperationPass<mlir::func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
LegalizeDataInRegionBase(const LegalizeDataInRegionBase &other) : ::mlir::OperationPass<mlir::func::FuncOp>(other) {}
LegalizeDataInRegionBase& operator=(const LegalizeDataInRegionBase &) = delete;
LegalizeDataInRegionBase(LegalizeDataInRegionBase &&) = delete;
LegalizeDataInRegionBase& operator=(LegalizeDataInRegionBase &&) = delete;
~LegalizeDataInRegionBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("openacc-legalize-data");
}
::llvm::StringRef getArgument() const override { return "openacc-legalize-data"; }
::llvm::StringRef getDescription() const override { return "Legalize the data in the compute region"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("LegalizeDataInRegion");
}
::llvm::StringRef getName() const override { return "LegalizeDataInRegion"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(LegalizeDataInRegionBase<DerivedT>)
protected:
::mlir::Pass::Option<bool> hostToDevice{*this, "host-to-device", ::llvm::cl::desc("Replace varPtr uses with accPtr if true. Replace accPtr uses with varPtr if false"), ::llvm::cl::init(true)};
};
#undef GEN_PASS_CLASSES
#endif