Skip to content

Commit a126789

Browse files
author
Alexander Batashev
committed
Merge branch 'sycl' into private/abatashe/host_accessor_refactor
* sycl: (1209 commits) [SYCL] Check exit status get_device_count_by_type [SYCL][Doc] Update sub-group extension docs (intel#1330) [SYCL][Doc] Add leader to GroupAlgorithms (intel#1297) [SYCL] Add SYCL headers search path to default compilation options (intel#1347) [SYCL][PI] Add interoperability with generic handles to device and program classes (intel#1244) Move SPIR devicelib to top level (intel#1276) [SYCL][Driver] Improve fat static library support (intel#1319) [SYCL] Remove image_api LIT (intel#1349) [SYCL] Fix headers location for check-sycl-deploy target [SYCL] Allow gcc asm statements in kernel code (intel#1341) [SYCL] Add Intel FPGA force_pow2_depth attribute (intel#1284) [SPIR-V][NFC] Fix for building llvm-spirv with -DLLVM_LINK_LLVM_DYLIB=ON (intel#1323) [SYCL][NFC] Fix execution graph dump (intel#1331) [SYCL][Doc] Release SYCL_INTEL_enqueue_barrier extension document (intel#1199) [SYCL][USM] Fix USM malloc_shared and free to handle zero byte (intel#1273) [SYCL] Fix undefined symbols in async_work_group_copy (intel#1243) [SYCL] Mark calls to barrier and work-item functions as convergent [SYCL][CUDA] Fix CUDA plug-in build with enabled assertions (intel#1325) [SYCL][Test] Add OpenCL requirement to test/ordered_queue/prop.cpp (intel#1335) [SYCL][CUDA] Improve CUDA backend documentation (intel#1293) ...
2 parents 05e4905 + 4fbf5e0 commit a126789

File tree

4,176 files changed

+105836
-49132
lines changed

Some content is hidden

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

4,176 files changed

+105836
-49132
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+

buildbot/configure.py

+16-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ def do_configure(args):
1111
sycl_dir = os.path.join(args.src_dir, "sycl")
1212
spirv_dir = os.path.join(args.src_dir, "llvm-spirv")
1313
xpti_dir = os.path.join(args.src_dir, "xpti")
14+
libdevice_dir = os.path.join(args.src_dir, "libdevice")
1415
ocl_header_dir = os.path.join(args.obj_dir, "OpenCL-Headers")
1516
icd_loader_lib = os.path.join(args.obj_dir, "OpenCL-ICD-Loader", "build")
1617
llvm_targets_to_build = 'X86'
17-
llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot;xpti'
18+
llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot;xpti;libdevice'
1819
libclc_targets_to_build = ''
1920
sycl_build_pi_cuda = 'OFF'
2021
llvm_enable_assertions = 'ON'
2122
llvm_enable_doxygen = 'OFF'
23+
llvm_build_shared_libs = 'OFF'
2224

2325
if platform.system() == 'Linux':
2426
icd_loader_lib = os.path.join(icd_loader_lib, "libOpenCL.so")
@@ -37,6 +39,9 @@ def do_configure(args):
3739
if args.docs:
3840
llvm_enable_doxygen = 'ON'
3941

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

4247
cmake_cmd = [
@@ -45,24 +50,29 @@ def do_configure(args):
4550
"-DCMAKE_BUILD_TYPE={}".format(args.build_type),
4651
"-DLLVM_ENABLE_ASSERTIONS={}".format(llvm_enable_assertions),
4752
"-DLLVM_TARGETS_TO_BUILD={}".format(llvm_targets_to_build),
48-
"-DLLVM_EXTERNAL_PROJECTS=sycl;llvm-spirv;opencl-aot;xpti",
53+
"-DLLVM_EXTERNAL_PROJECTS=sycl;llvm-spirv;opencl-aot;xpti;libdevice",
4954
"-DLLVM_EXTERNAL_SYCL_SOURCE_DIR={}".format(sycl_dir),
5055
"-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR={}".format(spirv_dir),
5156
"-DLLVM_EXTERNAL_XPTI_SOURCE_DIR={}".format(xpti_dir),
57+
"-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR={}".format(libdevice_dir),
5258
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
5359
"-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build),
54-
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
55-
"-DOpenCL_LIBRARY={}".format(icd_loader_lib),
5660
"-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda),
5761
"-DLLVM_BUILD_TOOLS=ON",
5862
"-DSYCL_ENABLE_WERROR=ON",
5963
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
6064
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.
6165
"-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen),
66+
"-DBUILD_SHARED_LIBS={}".format(llvm_build_shared_libs),
6267
"-DSYCL_ENABLE_XPTI_TRACING=ON", # Explicitly turn on XPTI tracing
6368
llvm_dir
6469
]
6570

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+
6676
print(cmake_cmd)
6777

6878
try:
@@ -93,6 +103,8 @@ def main():
93103
parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA")
94104
parser.add_argument("--assertions", action='store_true', help="build with assertions")
95105
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")
96108

97109
args = parser.parse_args()
98110

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)