Skip to content

Commit 0e84acf

Browse files
committed
Merge branch 'sycl' into devicelibTest
Signed-off-by: haonanya <[email protected]>
2 parents 6ef6fac + d9b178f commit 0e84acf

File tree

5,127 files changed

+157765
-67946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,127 files changed

+157765
-67946
lines changed
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Linux Post Commit Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- sycl
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
config: ["Default", "SharedLibs", "Assertions"]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
path: src
19+
- name: Install Ubuntu deps
20+
run: sudo apt install -y ninja-build
21+
- name: Configure
22+
run: |
23+
CONFIG=${{ matrix.config }}
24+
case $CONFIG in
25+
Default)
26+
export ARGS=""
27+
;;
28+
SharedLibs)
29+
export ARGS="--shared-libs"
30+
;;
31+
Assertiosn)
32+
export ARGS="--assertions"
33+
;;
34+
esac
35+
mkdir -p $GITHUB_WORKSPACE/build
36+
cd $GITHUB_WORKSPACE/build
37+
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
38+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --no-ocl $ARGS
39+
- name: Compile
40+
run: |
41+
python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \
42+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build
43+
- name: check-llvm
44+
if: always()
45+
run: |
46+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
47+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm
48+
- name: check-clang
49+
if: always()
50+
run: |
51+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
52+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-clang
53+
- name: check-sycl
54+
if: always()
55+
run: |
56+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
57+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-sycl
58+
- name: check-llvm-spirv
59+
if: always()
60+
run: |
61+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
62+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm-spirv
63+
- name: Pack
64+
run: tar -czvf llvm_sycl.tar.gz -C $GITHUB_WORKSPACE/build/install .
65+
- name: Upload artifacts
66+
uses: actions/upload-artifact@v1
67+
with:
68+
name: sycl_linux_${{ matrix.config }}
69+
path: llvm_sycl.tar.gz
70+

CONTRIBUTING.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributing
22

33
## License
4-
Intel Project for LLVM* technology is licensed under the terms of the
4+
Intel Project for LLVM\* technology is licensed under the terms of the
55
Apache-2.0 with LLVM-exception license ([LICENSE.txt](llvm/LICENSE.TXT))
66
to ensure our ability to contribute this project to the LLVM project
77
under the same license.
@@ -70,11 +70,11 @@ commit automatically with `git commit -s`.
7070
### Development
7171

7272
- Create a personal fork of the project on GitHub
73-
- Use **sycl** branch as baseline for your changes
73+
- For the DPC++ Compiler project, use **sycl** branch as baseline for your
74+
changes. See [Get Started Guide](sycl/doc/GetStartedGuide.md).
7475
- Prepare your patch (follow
7576
[LLVM coding standards](https://llvm.org/docs/CodingStandards.html))
76-
- Build the project and run all tests (see
77-
[GetStartedWithSYCLCompiler.md](sycl/doc/GetStartedWithSYCLCompiler.md))
77+
- Build the project and run all tests
7878

7979
### Review and acceptance testing
8080

@@ -94,4 +94,8 @@ Project maintainers merge pull requests using one of the following options:
9494
- [Squash and merge] Used when there are multiple commits in the PR
9595
- Squashing is done to make sure that the project is buildable on any commit
9696
- [Create a merge commit] Used for LLVM pull-down PRs to preserve hashes of the
97-
commits pulled from the LLVM community repository
97+
commits pulled from the LLVM community repository
98+
99+
100+
*Other names and brands may be claimed as the property of others.
101+

README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
# Intel Project for LLVM* technology
1+
# Intel Project for LLVM\* technology
22

33
## Introduction
44

55
Intel staging area for llvm.org contribution.
66
Home for Intel LLVM-based projects:
7-
- SYCL* Compiler and Runtimes - compiler and runtime libraries for SYCL ([https://www.khronos.org/sycl/](https://www.khronos.org/sycl/)). See **sycl** branch.
7+
- oneAPI Data Parallel C++ compiler - see **sycl** branch. More information on
8+
oneAPI and DPC++ is available at
9+
([https://www.oneapi.com/](https://www.oneapi.com/))
810

911
## License
1012
See [LICENSE.txt](sycl/LICENSE.TXT) for details.
1113

12-
1314
## Contributing
1415
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
1516

1617
## Sub-projects Documentation
17-
- SYCL Compiler and Runtimes - See [GetStartedWithSYCLCompiler.md](sycl/doc/GetStartedWithSYCLCompiler.md)
18+
- oneAPI Data Parallel C++ compiler - See
19+
[GetStartedGuide.md](sycl/doc/GetStartedGuide.md)
1820

19-
*Other names and brands may be claimed as the property of others.
21+
## DPC++ extensions
2022

21-
## SYCL Extension Proposal Documents
23+
DPC++ is an open, cross-architecture language built upon the ISO C++ and Khronos
24+
SYCL\* standards. DPC++ extends these standards with a number of extensions,
25+
which can be found in [sycl/doc/extensions](sycl/doc/extensions) directory.
2226

23-
See [sycl/doc/extensions](sycl/doc/extensions)
27+
\*Other names and brands may be claimed as the property of others.
2428

buildbot/configure.py

+19-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ def do_configure(args):
1010
llvm_dir = os.path.join(args.src_dir, "llvm")
1111
sycl_dir = os.path.join(args.src_dir, "sycl")
1212
spirv_dir = os.path.join(args.src_dir, "llvm-spirv")
13+
xpti_dir = os.path.join(args.src_dir, "xpti")
14+
libdevice_dir = os.path.join(args.src_dir, "libdevice")
1315
ocl_header_dir = os.path.join(args.obj_dir, "OpenCL-Headers")
1416
icd_loader_lib = os.path.join(args.obj_dir, "OpenCL-ICD-Loader", "build")
1517
llvm_targets_to_build = 'X86'
16-
llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot'
18+
llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot;xpti;libdevice'
1719
libclc_targets_to_build = ''
1820
sycl_build_pi_cuda = 'OFF'
1921
llvm_enable_assertions = 'ON'
2022
llvm_enable_doxygen = 'OFF'
23+
llvm_build_shared_libs = 'OFF'
2124

2225
if platform.system() == 'Linux':
2326
icd_loader_lib = os.path.join(icd_loader_lib, "libOpenCL.so")
@@ -36,6 +39,9 @@ def do_configure(args):
3639
if args.docs:
3740
llvm_enable_doxygen = 'ON'
3841

42+
if args.shared_libs:
43+
llvm_build_shared_libs = 'ON'
44+
3945
install_dir = os.path.join(args.obj_dir, "install")
4046

4147
cmake_cmd = [
@@ -44,22 +50,29 @@ def do_configure(args):
4450
"-DCMAKE_BUILD_TYPE={}".format(args.build_type),
4551
"-DLLVM_ENABLE_ASSERTIONS={}".format(llvm_enable_assertions),
4652
"-DLLVM_TARGETS_TO_BUILD={}".format(llvm_targets_to_build),
47-
"-DLLVM_EXTERNAL_PROJECTS=sycl;llvm-spirv;opencl-aot",
53+
"-DLLVM_EXTERNAL_PROJECTS=sycl;llvm-spirv;opencl-aot;xpti;libdevice",
4854
"-DLLVM_EXTERNAL_SYCL_SOURCE_DIR={}".format(sycl_dir),
4955
"-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR={}".format(spirv_dir),
56+
"-DLLVM_EXTERNAL_XPTI_SOURCE_DIR={}".format(xpti_dir),
57+
"-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR={}".format(libdevice_dir),
5058
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
5159
"-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build),
52-
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
53-
"-DOpenCL_LIBRARY={}".format(icd_loader_lib),
5460
"-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda),
5561
"-DLLVM_BUILD_TOOLS=ON",
5662
"-DSYCL_ENABLE_WERROR=ON",
5763
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
5864
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.
5965
"-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen),
66+
"-DBUILD_SHARED_LIBS={}".format(llvm_build_shared_libs),
67+
"-DSYCL_ENABLE_XPTI_TRACING=ON", # Explicitly turn on XPTI tracing
6068
llvm_dir
6169
]
6270

71+
if not args.no_ocl:
72+
cmake_cmd.extend([
73+
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
74+
"-DOpenCL_LIBRARY={}".format(icd_loader_lib)])
75+
6376
print(cmake_cmd)
6477

6578
try:
@@ -90,6 +103,8 @@ def main():
90103
parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA")
91104
parser.add_argument("--assertions", action='store_true', help="build with assertions")
92105
parser.add_argument("--docs", action='store_true', help="build Doxygen documentation")
106+
parser.add_argument("--no-ocl", action='store_true', help="download OpenCL deps via CMake")
107+
parser.add_argument("--shared-libs", action='store_true', help="Build shared libraries")
93108

94109
args = parser.parse_args()
95110

clang-tools-extra/clang-doc/HTMLGenerator.cpp

+11-9
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ genReference(const Reference &Type, StringRef CurrentDirectory,
314314
else
315315
return genLink(Type.Name, "#" + JumpToSection.getValue());
316316
}
317-
llvm::SmallString<128> Path =
318-
computeRelativePath(Type.Path, CurrentDirectory);
319-
llvm::sys::path::append(Path, Type.Name + ".html");
317+
llvm::SmallString<64> Path = Type.getRelativeFilePath(CurrentDirectory);
318+
llvm::sys::path::append(Path, Type.getFileBaseName() + ".html");
319+
320320
// Paths in HTML must be in posix-style
321321
llvm::sys::path::native(Path, llvm::sys::path::Style::posix);
322322
if (JumpToSection)
@@ -730,15 +730,17 @@ genHTML(const NamespaceInfo &I, Index &InfoIndex, const ClangDocContext &CDCtx,
730730
if (!I.Description.empty())
731731
Out.emplace_back(genHTML(I.Description));
732732

733+
llvm::SmallString<64> BasePath = I.getRelativeFilePath("");
734+
733735
std::vector<std::unique_ptr<TagNode>> ChildNamespaces =
734-
genReferencesBlock(I.ChildNamespaces, "Namespaces", I.Path);
736+
genReferencesBlock(I.ChildNamespaces, "Namespaces", BasePath);
735737
AppendVector(std::move(ChildNamespaces), Out);
736738
std::vector<std::unique_ptr<TagNode>> ChildRecords =
737-
genReferencesBlock(I.ChildRecords, "Records", I.Path);
739+
genReferencesBlock(I.ChildRecords, "Records", BasePath);
738740
AppendVector(std::move(ChildRecords), Out);
739741

740742
std::vector<std::unique_ptr<TagNode>> ChildFunctions =
741-
genFunctionsBlock(I.ChildFunctions, CDCtx, I.Path);
743+
genFunctionsBlock(I.ChildFunctions, CDCtx, BasePath);
742744
AppendVector(std::move(ChildFunctions), Out);
743745
std::vector<std::unique_ptr<TagNode>> ChildEnums =
744746
genEnumsBlock(I.ChildEnums, CDCtx);
@@ -860,8 +862,8 @@ llvm::Error HTMLGenerator::generateDocForInfo(Info *I, llvm::raw_ostream &OS,
860862
"unexpected info type");
861863
}
862864

863-
HTMLFile F =
864-
genInfoFile(InfoTitle, I->Path, MainContentNodes, InfoIndex, CDCtx);
865+
HTMLFile F = genInfoFile(InfoTitle, I->getRelativeFilePath(""),
866+
MainContentNodes, InfoIndex, CDCtx);
865867
F.Render(OS);
866868

867869
return llvm::Error::success();
@@ -902,7 +904,7 @@ static llvm::Error SerializeIndex(ClangDocContext &CDCtx) {
902904
J.attribute("USR", toHex(llvm::toStringRef(I.USR)));
903905
J.attribute("Name", I.Name);
904906
J.attribute("RefType", getRefType(I.RefType));
905-
J.attribute("Path", I.Path);
907+
J.attribute("Path", I.getRelativeFilePath(""));
906908
J.attributeArray("Children", [&] {
907909
for (const Index &C : I.Children)
908910
IndexToJSON(C);

0 commit comments

Comments
 (0)