Skip to content

Commit 3320249

Browse files
authored
[MLIR][NVVM] Make the call to findTool optional for fatbinary (#93968)
1 parent 99a0cd6 commit 3320249

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlir/lib/Target/LLVM/NVVM/Target.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,12 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
267267
std::optional<std::string> ptxasCompiler = findTool("ptxas");
268268
if (!ptxasCompiler)
269269
return std::nullopt;
270-
std::optional<std::string> fatbinaryTool = findTool("fatbinary");
271-
if (createFatbin && !fatbinaryTool)
272-
return std::nullopt;
270+
std::optional<std::string> fatbinaryTool;
271+
if (createFatbin) {
272+
fatbinaryTool = findTool("fatbinary");
273+
if (!fatbinaryTool)
274+
return std::nullopt;
275+
}
273276
Location loc = getOperation().getLoc();
274277

275278
// Base name for all temp files: mlir-<module name>-<target triple>-<chip>.

0 commit comments

Comments
 (0)