@@ -28,7 +28,7 @@ namespace fir {
28
28
using namespace fir ;
29
29
using namespace mlir ;
30
30
using namespace Fortran ::runtime;
31
- using namespace Fortran ::runtime::cuf ;
31
+ using namespace Fortran ::runtime::cuda ;
32
32
33
33
namespace {
34
34
@@ -79,11 +79,11 @@ static mlir::LogicalResult convertOpToCall(OpTy op,
79
79
}
80
80
81
81
struct CufAllocateOpConversion
82
- : public mlir::OpRewritePattern<:: cuf::AllocateOp> {
82
+ : public mlir::OpRewritePattern<cuf::AllocateOp> {
83
83
using OpRewritePattern::OpRewritePattern;
84
84
85
85
mlir::LogicalResult
86
- matchAndRewrite (:: cuf::AllocateOp op,
86
+ matchAndRewrite (cuf::AllocateOp op,
87
87
mlir::PatternRewriter &rewriter) const override {
88
88
// TODO: Allocation with source will need a new entry point in the runtime.
89
89
if (op.getSource ())
@@ -112,16 +112,16 @@ struct CufAllocateOpConversion
112
112
mlir::func::FuncOp func =
113
113
fir::runtime::getRuntimeFunc<mkRTKey (AllocatableAllocate)>(loc,
114
114
builder);
115
- return convertOpToCall<:: cuf::AllocateOp>(op, rewriter, func);
115
+ return convertOpToCall<cuf::AllocateOp>(op, rewriter, func);
116
116
}
117
117
};
118
118
119
119
struct CufDeallocateOpConversion
120
- : public mlir::OpRewritePattern<:: cuf::DeallocateOp> {
120
+ : public mlir::OpRewritePattern<cuf::DeallocateOp> {
121
121
using OpRewritePattern::OpRewritePattern;
122
122
123
123
mlir::LogicalResult
124
- matchAndRewrite (:: cuf::DeallocateOp op,
124
+ matchAndRewrite (cuf::DeallocateOp op,
125
125
mlir::PatternRewriter &rewriter) const override {
126
126
// TODO: Allocation of module variable will need more work as the descriptor
127
127
// will be duplicated and needs to be synced after allocation.
@@ -137,19 +137,19 @@ struct CufDeallocateOpConversion
137
137
mlir::func::FuncOp func =
138
138
fir::runtime::getRuntimeFunc<mkRTKey (AllocatableDeallocate)>(loc,
139
139
builder);
140
- return convertOpToCall<:: cuf::DeallocateOp>(op, rewriter, func);
140
+ return convertOpToCall<cuf::DeallocateOp>(op, rewriter, func);
141
141
}
142
142
};
143
143
144
- struct CufAllocOpConversion : public mlir ::OpRewritePattern<:: cuf::AllocOp> {
144
+ struct CufAllocOpConversion : public mlir ::OpRewritePattern<cuf::AllocOp> {
145
145
using OpRewritePattern::OpRewritePattern;
146
146
147
147
CufAllocOpConversion (mlir::MLIRContext *context, mlir::DataLayout *dl,
148
148
fir::LLVMTypeConverter *typeConverter)
149
149
: OpRewritePattern(context), dl{dl}, typeConverter{typeConverter} {}
150
150
151
151
mlir::LogicalResult
152
- matchAndRewrite (:: cuf::AllocOp op,
152
+ matchAndRewrite (cuf::AllocOp op,
153
153
mlir::PatternRewriter &rewriter) const override {
154
154
auto boxTy = mlir::dyn_cast_or_null<fir::BaseBoxType>(op.getInType ());
155
155
@@ -187,11 +187,11 @@ struct CufAllocOpConversion : public mlir::OpRewritePattern<::cuf::AllocOp> {
187
187
fir::LLVMTypeConverter *typeConverter;
188
188
};
189
189
190
- struct CufFreeOpConversion : public mlir ::OpRewritePattern<:: cuf::FreeOp> {
190
+ struct CufFreeOpConversion : public mlir ::OpRewritePattern<cuf::FreeOp> {
191
191
using OpRewritePattern::OpRewritePattern;
192
192
193
193
mlir::LogicalResult
194
- matchAndRewrite (:: cuf::FreeOp op,
194
+ matchAndRewrite (cuf::FreeOp op,
195
195
mlir::PatternRewriter &rewriter) const override {
196
196
// Only convert cuf.free on descriptor.
197
197
if (!mlir::isa<fir::ReferenceType>(op.getDevptr ().getType ()))
@@ -235,8 +235,8 @@ class CufOpConversion : public fir::impl::CufOpConversionBase<CufOpConversion> {
235
235
fir::LLVMTypeConverter typeConverter (module , /* applyTBAA=*/ false ,
236
236
/* forceUnifiedTBAATree=*/ false , *dl);
237
237
238
- target.addIllegalOp <:: cuf::AllocOp, :: cuf::AllocateOp, :: cuf::DeallocateOp,
239
- :: cuf::FreeOp>();
238
+ target.addIllegalOp <cuf::AllocOp, cuf::AllocateOp, cuf::DeallocateOp,
239
+ cuf::FreeOp>();
240
240
patterns.insert <CufAllocOpConversion>(ctx, &*dl, &typeConverter);
241
241
patterns.insert <CufAllocateOpConversion, CufDeallocateOpConversion,
242
242
CufFreeOpConversion>(ctx);
0 commit comments