Skip to content

Commit 913db74

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into private/asachkov/drop-esimd-emulator-legacy
2 parents ed3589e + 9cb370a commit 913db74

File tree

172 files changed

+1381
-1288
lines changed

Some content is hidden

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

172 files changed

+1381
-1288
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ sycl/include/sycl/ext/oneapi/experimental/graph.hpp @intel/sycl-graphs-reviewers
139139
sycl/source/detail/graph_impl.cpp @intel/sycl-graphs-reviewers
140140
sycl/source/detail/graph_impl.hpp @intel/sycl-graphs-reviewers
141141
sycl/unittests/Extensions/CommandGraph/ @intel/sycl-graphs-reviewers
142-
sycl/doc/design/CommandGraph.md @intel/sycl-graphs-reviewers
143142
sycl/test-e2e/Graph @intel/sycl-graphs-reviewers
143+
sycl/doc/design/CommandGraph.md @intel/sycl-graphs-reviewers
144144
sycl/doc/extensions/**/sycl_ext_oneapi_graph.asciidoc @intel/sycl-graphs-reviewers
145+
sycl/doc/syclgraph/ @intel/sycl-graphs-reviewers
145146

146147
# syclcompat library
147148
sycl/**/syclcompat/ @intel/syclcompat-lib-reviewers

.github/workflows/sycl-docs.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate Doxygen documentation
1+
name: Generate documentation
22

33
on:
44
schedule:
@@ -25,16 +25,14 @@ jobs:
2525
path: repo
2626
- name: Install deps
2727
run: |
28-
sudo apt-get install -y doxygen graphviz ssh ninja-build libhwloc-dev
28+
sudo apt-get install -y graphviz ssh ninja-build libhwloc-dev
2929
sudo pip3 install -r repo/llvm/docs/requirements.txt
3030
- name: Build Docs
3131
run: |
3232
mkdir -p $GITHUB_WORKSPACE/build
3333
cd $GITHUB_WORKSPACE/build
3434
python $GITHUB_WORKSPACE/repo/buildbot/configure.py -w $GITHUB_WORKSPACE \
3535
-s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs
36-
cmake --build . --target doxygen-sycl
37-
cmake --build . --target doxygen-clang
3836
cmake --build . --target docs-sycl-html
3937
cmake --build . --target docs-clang-html
4038
- name: Deploy
@@ -52,9 +50,7 @@ jobs:
5250
git rm -rf .
5351
touch .nojekyll
5452
yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* .
55-
mv $GITHUB_WORKSPACE/build/tools/sycl/doc/doxygen/html doxygen/
5653
mv $GITHUB_WORKSPACE/build/tools/clang/docs/html clang/
57-
mv $GITHUB_WORKSPACE/build/tools/clang/docs/doxygen/html clang_doxygen/
5854
git config --global user.name "iclsrc"
5955
git config --global user.email "[email protected]"
6056
git add .

buildbot/configure.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def do_configure(args):
116116
llvm_enable_assertions = "OFF"
117117

118118
if args.docs:
119-
llvm_enable_doxygen = "ON"
120119
llvm_enable_sphinx = "ON"
121120

122121
if args.shared_libs:

clang/include/clang/Driver/Options.td

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7049,9 +7049,16 @@ def fsycl_remove_unused_external_funcs : Flag<["-"], "fsycl-remove-unused-extern
70497049
def fno_sycl_remove_unused_external_funcs : Flag<["-"], "fno-sycl-remove-unused-external-funcs">,
70507050
HelpText<"Prevent removal of unused `SYCL_EXTERNAL` functions">;
70517051
def fsycl_allow_device_dependencies : Flag<["-"], "fsycl-allow-device-dependencies">,
7052-
HelpText<"Allow dependencies between device code images">;
7052+
HelpText<"Deprecated: please use -fsycl-allow-device-image-dependencies instead.">,
7053+
Flags<[Deprecated]>;
70537054
def fno_sycl_allow_device_dependencies : Flag<["-"], "fno-sycl-allow-device-dependencies">,
7054-
HelpText<"Do not allow dependencies between device code images (default)">;
7055+
HelpText<"Deprecated: please use -fno-sycl-allow-device-image-dependencies instead.">,
7056+
Flags<[Deprecated]>;
7057+
7058+
defm sycl_allow_device_image_dependencies: BoolOptionWithoutMarshalling<"f", "sycl-allow-device-image-dependencies",
7059+
PosFlag<SetTrue, [], [ClangOption], "Allow dependencies between device code images">,
7060+
NegFlag<SetFalse, [], [ClangOption], "Do not allow dependencies between device code images (default)">>;
7061+
70557062
def fsycl_dump_device_code_EQ : Joined<["-"], "fsycl-dump-device-code=">,
70567063
Flags<[NoXarchOption]>,
70577064
HelpText<"Dump device code into the user provided directory.">;

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2738,7 +2738,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
27382738
ConstWithoutErrnoOrExceptions && ErrnoOverridenToFalseWithOpt;
27392739
}
27402740
if (GenerateIntrinsics &&
2741-
!(getLangOpts().SYCLIsDevice && getTarget().getTriple().isNVPTX())) {
2741+
!(getLangOpts().SYCLIsDevice && (getTarget().getTriple().isNVPTX() ||
2742+
getTarget().getTriple().isAMDGCN()))) {
27422743
switch (BuiltinIDIfNoAsmLabel) {
27432744
case Builtin::BIacos:
27442745
case Builtin::BIacosf:

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5555,7 +5555,7 @@ class OffloadingActionBuilder final {
55555555
// AOT compilation.
55565556
bool SYCLDeviceLibLinked = false;
55575557
Action *NativeCPULib = nullptr;
5558-
if (IsSPIR || IsNVPTX || IsSYCLNativeCPU) {
5558+
if (IsSPIR || IsNVPTX || IsAMDGCN || IsSYCLNativeCPU) {
55595559
bool UseJitLink =
55605560
IsSPIR &&
55615561
Args.hasFlag(options::OPT_fsycl_device_lib_jit_link,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10801,10 +10801,17 @@ static void addArgs(ArgStringList &DstArgs, const llvm::opt::ArgList &Alloc,
1080110801
}
1080210802
}
1080310803

10804-
static bool allowDeviceDependencies(const llvm::opt::ArgList &TCArgs) {
10804+
static bool allowDeviceImageDependencies(const llvm::opt::ArgList &TCArgs) {
10805+
// deprecated
1080510806
if (TCArgs.hasFlag(options::OPT_fsycl_allow_device_dependencies,
1080610807
options::OPT_fno_sycl_allow_device_dependencies, false))
1080710808
return true;
10809+
10810+
// preferred
10811+
if (TCArgs.hasFlag(options::OPT_fsycl_allow_device_image_dependencies,
10812+
options::OPT_fno_sycl_allow_device_image_dependencies, false))
10813+
return true;
10814+
1080810815
return false;
1080910816
}
1081010817

@@ -10835,7 +10842,7 @@ static void getNonTripleBasedSYCLPostLinkOpts(const ToolChain &TC,
1083510842
options::OPT_fsycl_esimd_force_stateless_mem, false))
1083610843
addArgs(PostLinkArgs, TCArgs, {"-lower-esimd-force-stateless-mem=false"});
1083710844

10838-
if (allowDeviceDependencies(TCArgs))
10845+
if (allowDeviceImageDependencies(TCArgs))
1083910846
addArgs(PostLinkArgs, TCArgs, {"-allow-device-image-dependencies"});
1084010847
}
1084110848

@@ -10853,7 +10860,7 @@ static bool shouldEmitOnlyKernelsAsEntryPoints(const ToolChain &TC,
1085310860
return true;
1085410861
// When supporting dynamic linking, non-kernels in a device image can be
1085510862
// called.
10856-
if (allowDeviceDependencies(TCArgs))
10863+
if (allowDeviceImageDependencies(TCArgs))
1085710864
return false;
1085810865
if (Triple.isNVPTX() || Triple.isAMDGPU())
1085910866
return false;

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ static bool selectBfloatLibs(const llvm::Triple &Triple, const Compilation &C,
165165

166166
// spir64 target is actually JIT compilation, so we defer selection of
167167
// bfloat16 libraries to runtime. For AOT we need libraries, but skip
168-
// for Nvidia.
169-
NeedLibs =
170-
Triple.getSubArch() != llvm::Triple::NoSubArch && !Triple.isNVPTX();
168+
// for Nvidia and AMD.
169+
NeedLibs = Triple.getSubArch() != llvm::Triple::NoSubArch &&
170+
!Triple.isNVPTX() && !Triple.isAMDGCN();
171171
UseNative = false;
172172
if (NeedLibs && Triple.getSubArch() == llvm::Triple::SPIRSubArch_gen &&
173173
C.hasOffloadToolChain<Action::OFK_SYCL>()) {
@@ -212,9 +212,9 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
212212
SmallVector<std::string, 8> LibraryList;
213213
const llvm::opt::ArgList &Args = C.getArgs();
214214

215-
// For NVPTX we only use one single bitcode library and ignore
215+
// For NVPTX and AMDGCN we only use one single bitcode library and ignore
216216
// manually specified SYCL device libraries.
217-
bool IgnoreSingleLibs = TargetTriple.isNVPTX();
217+
bool IgnoreSingleLibs = TargetTriple.isNVPTX() || TargetTriple.isAMDGCN();
218218

219219
struct DeviceLibOptInfo {
220220
StringRef DeviceLibName;
@@ -278,6 +278,9 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
278278
if (TargetTriple.isNVPTX() && IgnoreSingleLibs)
279279
LibraryList.push_back(Args.MakeArgString("devicelib--cuda.bc"));
280280

281+
if (TargetTriple.isAMDGCN() && IgnoreSingleLibs)
282+
LibraryList.push_back(Args.MakeArgString("devicelib--amd.bc"));
283+
281284
if (IgnoreSingleLibs)
282285
return LibraryList;
283286

@@ -1812,22 +1815,18 @@ void SYCLToolChain::AddSYCLIncludeArgs(const clang::driver::Driver &Driver,
18121815
const ArgList &DriverArgs,
18131816
ArgStringList &CC1Args) {
18141817
// Add the SYCL header search locations in the specified order.
1815-
// ../include/sycl
18161818
// ../include/sycl/stl_wrappers
18171819
// ../include
18181820
SmallString<128> IncludePath(Driver.Dir);
18191821
llvm::sys::path::append(IncludePath, "..");
18201822
llvm::sys::path::append(IncludePath, "include");
1821-
SmallString<128> SYCLPath(IncludePath);
1822-
llvm::sys::path::append(SYCLPath, "sycl");
18231823
// This is used to provide our wrappers around STL headers that provide
18241824
// additional functions/template specializations when the user includes those
18251825
// STL headers in their programs (e.g., <complex>).
1826-
SmallString<128> STLWrappersPath(SYCLPath);
1826+
SmallString<128> STLWrappersPath(IncludePath);
1827+
llvm::sys::path::append(STLWrappersPath, "sycl");
18271828
llvm::sys::path::append(STLWrappersPath, "stl_wrappers");
18281829
CC1Args.push_back("-internal-isystem");
1829-
CC1Args.push_back(DriverArgs.MakeArgString(SYCLPath));
1830-
CC1Args.push_back("-internal-isystem");
18311830
CC1Args.push_back(DriverArgs.MakeArgString(STLWrappersPath));
18321831
CC1Args.push_back("-internal-isystem");
18331832
CC1Args.push_back(DriverArgs.MakeArgString(IncludePath));

clang/test/CodeGenSYCL/sycl-libdevice-cmath.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
// RUN: %clang_cc1 %s -fsycl-is-device -triple nvptx64-nvidia-cuda -emit-llvm -o - | FileCheck %s
99
// RUN: %clang_cc1 %s -fsycl-is-device -triple nvptx64-nvidia-cuda -ffast-math -emit-llvm -o - | FileCheck %s
10+
// RUN: %clang_cc1 %s -fsycl-is-device -triple amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
11+
// RUN: %clang_cc1 %s -fsycl-is-device -triple amdgcn-amd-amdhsa -ffast-math -emit-llvm -o - | FileCheck %s
1012

1113
#include "Inputs/sycl.hpp"
1214

clang/test/Driver/Inputs/SYCL/lib/devicelib--amd.bc

Whitespace-only changes.

0 commit comments

Comments
 (0)