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
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
29 changes: 29 additions & 0 deletions clang/test/dpct/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import os
import re
import sys
import platform
import subprocess
import shutil

# Get CUDA installation path from environment variable CUDA_PATH,
# if $CUDA_PATH not found, default is '/usr/local/cuda'
Expand Down Expand Up @@ -67,3 +69,30 @@ if cuda_found:
config.substitutions.append(('%cuda-path', cuda_path))
else:
config.unsupported = True

# Run the dpct sanity test.
if not config.unsupported:
out_root_path = os.path.join(config.test_source_root, "dpct", "dpct_out")
dpct_cmd = os.path.join(config.llvm_tools_dir, "dpct") + " " + \
os.path.join(config.test_source_root, "dpct", "sanity_test.cu") + \
" --cuda-include-path=" + os.path.join(cuda_path, "include") + \
" --out-root=" + out_root_path
run_on_shell = False
if platform.system() == 'Linux':
run_on_shell = True
print(config.test_source_root)
complete_process = subprocess.run(dpct_cmd, shell=run_on_shell, check=False,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
encoding="utf-8", timeout=120)
if os.path.exists(out_root_path):
shutil.rmtree(out_root_path)
if complete_process.returncode != 0:
err_message = ""
if "'cudnn.h' file not found" in complete_process.stdout:
err_message = "'cudnn.h' header file not found in platform. " + \
"Please make sure install the cuDNN package.\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

export cudnn.h in CPATH.

elif "'nccl.h' file not found" in complete_process.stdout:
err_message = "'nccl.h' header file not found in platform." + \
" Please make sure install the NCCL package.\n"
sys.stderr.write(err_message)
config.unsupported = True
7 changes: 7 additions & 0 deletions clang/test/dpct/sanity_test.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// RUN: echo ""
#include <nccl.h>
#include <cudnn.h>

int main() {

}