Skip to content

Commit 16a1384

Browse files
chsiggcopybara-github
authored andcommitted
[NFC] Uppercase getGpu*AttrName() and createMemrefToTfrtGpuConverter() function names.
PiperOrigin-RevId: 444316249
1 parent 5606880 commit 16a1384

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

backends/gpu/include/tfrt/gpu/passes/passes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ struct StreamifyOpConversionPattern : mlir::OpConversionPattern<OpTy> {
7373
unsigned GetTypeSizeBytes(const mlir::Type& type);
7474

7575
// Returns the name of the device code attribute of gpu.module ops.
76-
mlir::StringRef getGpuBinaryAttrName();
76+
mlir::StringRef GetGpuBinaryAttrName();
7777
// Returns the name of the device constants attribute of gpu.module ops.
78-
mlir::StringRef getGpuConstantsAttrName();
78+
mlir::StringRef GetGpuConstantsAttrName();
7979
// Returns the name of the gpu.module symbol attribute of memref.get_global ops.
80-
mlir::StringRef getGpuModuleAttrName();
80+
mlir::StringRef GetGpuModuleAttrName();
8181

8282
// Returns a type converter which maps memref to !tfrt_gpu.buffer and provides
8383
// the corresponding unrealized_conversion_cast materializers.
84-
mlir::TypeConverter createMemrefToTfrtGpuConverter();
84+
mlir::TypeConverter CreateMemrefToTfrtGpuConverter();
8585

8686
// Adds rewrite patterns that wraps consecutive legal ops as defined by
8787
// `target` into a tfrt_gpu.streamify op.

backends/gpu/lib/passes/gpu_to_tfrt_passes.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ static Value CreateSetGlobal(ConversionPatternRewriter &rewriter,
10771077
LogicalResult ConvertGpuModulePattern::matchAndRewrite(
10781078
mlir::gpu::GPUModuleOp module_op, OpAdaptor adaptor,
10791079
ConversionPatternRewriter &rewriter) const {
1080-
auto data = module_op->getAttrOfType<StringAttr>(getGpuBinaryAttrName());
1080+
auto data = module_op->getAttrOfType<StringAttr>(GetGpuBinaryAttrName());
10811081
if (!data)
10821082
return rewriter.notifyMatchFailure(module_op, "no device code attribute");
10831083
if (data.size() == 0) {
@@ -1087,7 +1087,7 @@ LogicalResult ConvertGpuModulePattern::matchAndRewrite(
10871087
}
10881088
Location loc = module_op->getLoc();
10891089
auto constants =
1090-
module_op->getAttrOfType<ArrayAttr>(getGpuConstantsAttrName());
1090+
module_op->getAttrOfType<ArrayAttr>(GetGpuConstantsAttrName());
10911091
mlir::FunctionType func_type = rewriter.getFunctionType(
10921092
rewriter.getType<ContextType>(), rewriter.getType<ModuleType>());
10931093
func::FuncOp func_op = rewriter.replaceOpWithNewOp<func::FuncOp>(
@@ -1129,7 +1129,7 @@ LogicalResult ConvertMemrefGlobalPattern::matchAndRewrite(
11291129

11301130
// If the global is a GPU module symbol, return that.
11311131
if (auto module_attr =
1132-
global_op->getAttrOfType<FlatSymbolRefAttr>(getGpuModuleAttrName())) {
1132+
global_op->getAttrOfType<FlatSymbolRefAttr>(GetGpuModuleAttrName())) {
11331133
auto once_op = rewriter.create<compiler::OnceOp>(
11341134
loc, rewriter.getType<ModuleType>(), ValueRange(context), module_attr);
11351135
Value buffer = rewriter.create<ModuleGetGlobalOp>(
@@ -1588,7 +1588,7 @@ void ConvertGpuToTfrtGpuPass::runOnOperation() {
15881588
// Rewrite `gpu.module` before rewriting the referenced `memref.global` ops.
15891589
if (failed(ConvertGpuModuleOps(getOperation()))) return signalPassFailure();
15901590

1591-
auto converter = createMemrefToTfrtGpuConverter();
1591+
auto converter = CreateMemrefToTfrtGpuConverter();
15921592
ConversionTarget target(getContext());
15931593

15941594
// Rewrite `memref.load` before `tfrt_gpu.streamify` is inlined.
@@ -1710,11 +1710,11 @@ static Value MaterializeCast(OpBuilder &builder, Type type, ValueRange values,
17101710
return builder.create<CastOp>(loc, type, values).getResult(0);
17111711
}
17121712

1713-
StringRef getGpuBinaryAttrName() { return "binary"; }
1714-
StringRef getGpuConstantsAttrName() { return "constants"; }
1715-
StringRef getGpuModuleAttrName() { return "gpu_module"; }
1713+
StringRef GetGpuBinaryAttrName() { return "binary"; }
1714+
StringRef GetGpuConstantsAttrName() { return "constants"; }
1715+
StringRef GetGpuModuleAttrName() { return "gpu_module"; }
17161716

1717-
TypeConverter createMemrefToTfrtGpuConverter() {
1717+
TypeConverter CreateMemrefToTfrtGpuConverter() {
17181718
TypeConverter converter;
17191719
converter.addConversion([](Type type) { return type; });
17201720
converter.addConversion([&](BaseMemRefType type) {

0 commit comments

Comments
 (0)