Skip to content

Commit bbecd42

Browse files
authored
[mlir][sparse] cleanup sparse tensor materialization parameter setup (#68956)
1 parent 3d75c7c commit bbecd42

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,27 +209,12 @@ class NewCallParams final {
209209
genMapBuffers(builder, loc, stt, dimSizesValues, params[kParamDimSizes],
210210
params[kParamDim2Lvl], params[kParamLvl2Dim]);
211211
// Secondary and primary types encoding.
212-
setTemplateTypes(stt);
213-
// Finally, make note that initialization is complete.
214-
assert(isInitialized() && "Initialization failed");
215-
// And return `this` for method chaining.
216-
return *this;
217-
}
218-
219-
/// (Re)sets the C++ template type parameters, and returns `this`
220-
/// for method chaining. This is already done as part of `genBuffers`,
221-
/// but is factored out so that it can also be called independently
222-
/// whenever subsequent `genNewCall` calls want to reuse the same
223-
/// buffers but different type parameters.
224-
//
225-
// TODO: This is only ever used by sparse2sparse-viaCOO `ConvertOp`;
226-
// is there a better way to handle that than this one-off setter method?
227-
NewCallParams &setTemplateTypes(SparseTensorType stt) {
228212
const auto enc = stt.getEncoding();
229213
params[kParamPosTp] = constantPosTypeEncoding(builder, loc, enc);
230214
params[kParamCrdTp] = constantCrdTypeEncoding(builder, loc, enc);
231215
params[kParamValTp] =
232216
constantPrimaryTypeEncoding(builder, loc, stt.getElementType());
217+
// Return `this` for method chaining.
233218
return *this;
234219
}
235220

0 commit comments

Comments
 (0)