Skip to content

Commit 016bcc5

Browse files
Merge remote-tracking branch 'sycl' into mix-sycl-esimd-split-3
2 parents 147eb5f + a05f5de commit 016bcc5

File tree

71 files changed

+566
-364
lines changed

Some content is hidden

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

71 files changed

+566
-364
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ xpti/ @tovinkere @andykaylor
9595
xptifw/ @tovinkere @andykaylor
9696

9797
# DPC++ tools
98-
llvm/tools/file-table-tform/ @kbobrovs @AlexeySachkov
99-
llvm/tools/llvm-foreach/ @AlexeySachkov @Fznamznon
100-
llvm/tools/llvm-no-spir-kernel/ @AGindinson @AlexeySachkov
101-
llvm/tools/sycl-post-link/ @kbobrovs @AlexeySachkov
98+
llvm/**/file-table-tform/ @kbobrovs @AlexeySachkov
99+
llvm/**/llvm-foreach/ @AlexeySachkov @Fznamznon
100+
llvm/**/llvm-no-spir-kernel/ @AGindinson @AlexeySachkov
101+
llvm/**/sycl-post-link/ @kbobrovs @AlexeySachkov
102102

103103
# Clang offload tools
104104
clang/tools/clang-offload-bundler/ @kbobrovs @sndmitriev

.github/workflows/linux_post_commit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ jobs:
2626
export ARGS=""
2727
;;
2828
SharedLibs)
29+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
30+
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main"
31+
sudo apt-get update
32+
sudo apt-get install -y clang-12
2933
export ARGS="--shared-libs"
34+
export CC="clang-12"
35+
export CXX="clang++-12"
3036
;;
3137
NoAssertions)
3238
export ARGS="--no-assertions"

buildbot/dependency.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ocl_cpu_rt_ver=2020.11.11.0.04
44
# https://github.com/intel/llvm/releases/download/2020-WW45/win-oclcpuexp-2020.11.11.0.04_rel.zip
55
ocl_cpu_rt_ver_win=2020.11.11.0.04
66
# Same GPU driver supports Level Zero and OpenCL
7-
# https://github.com/intel/compute-runtime/releases/tag/21.01.18793
8-
ocl_gpu_rt_ver=21.01.18793
7+
# https://github.com/intel/compute-runtime/releases/tag/21.02.18820
8+
ocl_gpu_rt_ver=21.02.18820
99
# Same GPU driver supports Level Zero and OpenCL
1010
# https://downloadmirror.intel.com/30066/a08/igfx_win10_100.9030.zip
1111
ocl_gpu_rt_ver_win=27.20.100.9030
@@ -26,7 +26,7 @@ ocloc_ver_win=27.20.100.8935
2626
[DRIVER VERSIONS]
2727
cpu_driver_lin=2020.11.11.0.04
2828
cpu_driver_win=2020.11.11.0.04
29-
gpu_driver_lin=21.01.18793
29+
gpu_driver_lin=21.02.18820
3030
gpu_driver_win=27.20.100.9030
3131
fpga_driver_lin=2020.11.11.0.04
3232
fpga_driver_win=2020.11.11.0.04

clang/include/clang/Sema/Sema.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12884,6 +12884,11 @@ class Sema final {
1288412884
void MarkDevice();
1288512885
void MarkSyclSimd();
1288612886

12887+
/// Diagnoses an attribute in the 'intelfpga' namespace and suggests using
12888+
/// the attribute in the 'intel' namespace instead.
12889+
void CheckDeprecatedSYCLAttributeSpelling(const ParsedAttr &A,
12890+
StringRef NewName = "");
12891+
1288712892
/// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
1288812893
/// context is "used as device code".
1288912894
///

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@ void SYCL::constructLLVMForeachCommand(Compilation &C, const JobAction &JA,
9595
Foreach, ForeachArgs, None));
9696
}
9797

98+
// The list should match pre-built SYCL device library files located in
99+
// compiler package. Once we add or remove any SYCL device library files,
100+
// the list should be updated accordingly.
101+
static llvm::SmallVector<StringRef, 10> SYCLDeviceLibList{
102+
"crt",
103+
"cmath",
104+
"cmath-fp64",
105+
"complex",
106+
"complex-fp64",
107+
"fallback-cassert",
108+
"fallback-cmath",
109+
"fallback-cmath-fp64",
110+
"fallback-complex",
111+
"fallback-complex-fp64"};
112+
98113
const char *SYCL::Linker::constructLLVMLinkCommand(
99114
Compilation &C, const JobAction &JA, const InputInfo &Output,
100115
const ArgList &Args, StringRef SubArchName, StringRef OutputFilePrefix,
@@ -116,16 +131,32 @@ const char *SYCL::Linker::constructLLVMLinkCommand(
116131
// an actual object/archive. Take that list and pass those to the linker
117132
// instead of the original object.
118133
if (JA.isDeviceOffloading(Action::OFK_SYCL)) {
119-
auto SYCLDeviceLibIter =
120-
std::find_if(InputFiles.begin(), InputFiles.end(), [](const auto &II) {
121-
StringRef InputFilename =
122-
llvm::sys::path::filename(StringRef(II.getFilename()));
123-
if (InputFilename.startswith("libsycl-") &&
124-
InputFilename.endswith(".o"))
125-
return true;
126-
return false;
127-
});
128-
bool LinkSYCLDeviceLibs = (SYCLDeviceLibIter != InputFiles.end());
134+
auto isSYCLDeviceLib = [&C](const InputInfo &II) {
135+
const ToolChain *HostTC = C.getSingleOffloadToolChain<Action::OFK_Host>();
136+
StringRef LibPostfix = ".o";
137+
if (HostTC->getTriple().isWindowsMSVCEnvironment() &&
138+
C.getDriver().IsCLMode())
139+
LibPostfix = ".obj";
140+
StringRef InputFilename =
141+
llvm::sys::path::filename(StringRef(II.getFilename()));
142+
if (!InputFilename.startswith("libsycl-") ||
143+
!InputFilename.endswith(LibPostfix) || (InputFilename.count('-') < 2))
144+
return false;
145+
size_t PureLibNameLen = InputFilename.find_last_of('-');
146+
// Skip the prefix "libsycl-"
147+
StringRef PureLibName = InputFilename.substr(8, PureLibNameLen - 8);
148+
for (const auto &L : SYCLDeviceLibList) {
149+
if (PureLibName.compare(L) == 0)
150+
return true;
151+
}
152+
return false;
153+
};
154+
size_t InputFileNum = InputFiles.size();
155+
bool LinkSYCLDeviceLibs = (InputFileNum >= 2);
156+
LinkSYCLDeviceLibs = LinkSYCLDeviceLibs && !isSYCLDeviceLib(InputFiles[0]);
157+
for (size_t Idx = 1; Idx < InputFileNum; ++Idx)
158+
LinkSYCLDeviceLibs =
159+
LinkSYCLDeviceLibs && isSYCLDeviceLib(InputFiles[Idx]);
129160
// Go through the Inputs to the link. When a listfile is encountered, we
130161
// know it is an unbundled generated list.
131162
if (LinkSYCLDeviceLibs)

0 commit comments

Comments
 (0)