Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCLomatic]Emit a wanring when the CCL and DNN header files are not … #388

Merged
merged 4 commits into from
Dec 7, 2022
Merged
Changes from 1 commit
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
Next Next commit
[SYCLomatic]Emit a wanring when the CCL and DNN header files are not …
…found.
  • Loading branch information
ShengchenJ committed Dec 1, 2022
commit 2a1bcfd797d92192ab08b461317d98ca53bef99e
12 changes: 12 additions & 0 deletions clang/lib/DPCT/ASTTraversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,18 @@ void IncludesCallbacks::InclusionDirective(
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
SrcMgr::CharacteristicKind FileType) {
if (!File) {
auto emitWarning = [](std::string PackageName) {
llvm::errs() << "Warning: Could not detect path to " << PackageName<<
" header files. Please set up the header files correctly.";
};
std::string PackageName = "";
if (FileName.compare(StringRef("nccl.h")) == 0) {
emitWarning("NCCL");
} else if(FileName.compare(StringRef("cudnn.h")) == 0) {
emitWarning("cuDNN");
}
}
// Record the locations of the first and last inclusion directives in a file
DpctGlobalInfo::getInstance().setFirstIncludeLocation(HashLoc);
LastInclusionLocationUpdater Updater{FilenameRange.getEnd()};
Expand Down