Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions clang/tools/offload-arch/AMDGPUArchByHIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ int printGPUsByHIP() {
llvm::sys::DynamicLibrary::getPermanentLibrary(DynamicHIPPath.c_str(),
&ErrMsg));
if (!DynlibHandle->isValid()) {
llvm::errs() << "Failed to load " << DynamicHIPPath << ": " << ErrMsg
<< '\n';
if (Verbose)
llvm::errs() << "Failed to load " << DynamicHIPPath << ": " << ErrMsg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors should start with lowercase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably do a big monolithic NFC that updates a lot of cases like this.

<< '\n';
return 1;
}

Expand Down
7 changes: 6 additions & 1 deletion clang/tools/offload-arch/NVPTXArch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

using namespace llvm;

extern cl::opt<bool> Verbose;

typedef enum cudaError_enum {
CUDA_SUCCESS = 0,
CUDA_ERROR_NO_DEVICE = 100,
Expand Down Expand Up @@ -78,7 +80,10 @@ static int handleError(CUresult Err) {
int printGPUsByCUDA() {
// Attempt to load the NVPTX driver runtime.
if (llvm::Error Err = loadCUDA()) {
logAllUnhandledErrors(std::move(Err), llvm::errs());
if (Verbose)
logAllUnhandledErrors(std::move(Err), llvm::errs());
else
consumeError(std::move(Err));
return 1;
}

Expand Down