MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / extractVersionFromResult

Method extractVersionFromResult

tools/cuda-tile-tblgen/BytecodeGenUtilities.cpp:183–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183std::pair<std::string, std::string>
184mlir::tblgen::extractVersionFromResult(unsigned resultIndex,
185 const Operator &op) {
186 assert(resultIndex < static_cast<unsigned>(op.getNumResults()) &&
187 "TableGen backend bug: result index out of bounds");
188
189 // Look for version metadata in result decorators.
190 for (const auto &decorator : op.getResultDecorators(resultIndex)) {
191 if (!decorator.getDef().isSubClassOf("CudaTileArgMetadata"))
192 continue;
193
194 const std::string version =
195 decorator.getDef().getValueAsString("sinceVersion").str();
196 return parseVersion(version);
197 }
198
199 // Result missing required metadata.
200 const auto &result = op.getResult(resultIndex);
201 PrintFatalError(op.getLoc(),
202 "result '" + result.name.str() + "' in operation '" +
203 op.getOperationName() +
204 "' is missing version metadata (CudaTileArgMetadata)");
205}

Callers

nothing calls this directly

Calls 1

getOperationNameMethod · 0.45

Tested by

no test coverage detected