Skip to content

Commit 8dec0ed

Browse files
authored
Fix compiler warnings from Membar virtual function change (#7324)
Fixes the `'mlir::MembarOrFenceAnalysis' has virtual functions but non-virtual destructor` warning that occurs due to adding a virtual function to the `MembarOrFenceAnalysis` base class. This error fails our `-Werror` check because we do not disable `non-virtual-dtor`. I also fixed `warning: field 'numCols' will be initialized after field 'numRows'` since it showed up in my error trace, but this is not a warning that prompts errors, so there may be other locations where this warning is occurring.
1 parent 272188c commit 8dec0ed

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/triton/Analysis/Membar.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class MembarOrFenceAnalysis {
119119
explicit MembarOrFenceAnalysis(Allocation *allocation, MembarFilterFn filter)
120120
: allocation(allocation), filter(filter) {}
121121

122+
virtual ~MembarOrFenceAnalysis() = default;
123+
122124
/// Runs the membar analysis to the given operation, inserts a barrier if
123125
/// necessary.
124126
void run(FuncBlockInfoMapT &funcBlockInfoMap);
@@ -160,6 +162,8 @@ class MembarAnalysis : public MembarOrFenceAnalysis {
160162
explicit MembarAnalysis(Allocation *allocation, MembarFilterFn filter)
161163
: MembarOrFenceAnalysis(allocation, filter) {}
162164

165+
~MembarAnalysis() override = default;
166+
163167
private:
164168
/// Updates the BlockInfo operation based on the operation.
165169
virtual void update(Operation *operation, BlockInfo *blockInfo,

include/triton/Dialect/TritonNvidiaGPU/IR/Dialect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ struct TensorMemory : public SideEffects::Resource::Base<TensorMemory> {
5151
struct TMemAllocation {
5252
TMemAllocation(int numCols, int numRows)
5353
: numCols(numCols), numRows(numRows) {}
54-
int numRows;
5554
int numCols;
55+
int numRows;
5656
};
5757

5858
TMemAllocation getTmemAllocSizes(gpu::MemDescType memDescType);

0 commit comments

Comments
 (0)