Skip to content

Commit

Permalink
[opencl-aot] Fix regression in error reporting (#12022)
Browse files Browse the repository at this point in the history
This patch fixes a regression in error reporting, previously compiler
build log was printed to `std::cerr`, but now it doesn't print by
default. It makes it difficult for developers to understand what's going
on. So now the compiler build log is printed to `std::cerr` if there is
an error message, and to verbose logs if compilation was successful but
there is something in the compiler build logs.
  • Loading branch information
dm-vodopyanov authored Nov 28, 2023
1 parent 5d75245 commit 9ab06d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions opencl/opencl-aot/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,13 @@ int main(int Argc, char *Argv[]) {
}

if (!CompilerBuildLog.empty()) {
logs() << "\n"
<< CmdToCmdInfoMap[OptCommand].first << " log:\n"
<< CompilerBuildLog << '\n';
std::string CompilerBuildLogMessage = "\n" +
CmdToCmdInfoMap[OptCommand].first +
" log:\n" + CompilerBuildLog + '\n';
if (!ErrorMessage.empty())
std::cerr << CompilerBuildLogMessage;
else
logs() << CompilerBuildLogMessage;
}

if (clFailed(CLErr)) {
Expand Down

0 comments on commit 9ab06d1

Please sign in to comment.