Skip to content

Commit 07f3686

Browse files
author
Alexander Batashev
committed
Merge remote-tracking branch 'upstream/sycl' into sycl_interop
* upstream/sycl: Add ITT stubs and wrappers for SPIR-V devices (intel#3279) [SYCL] Add zero argument version of buffer::reinterpret() for SYCL 2020 (intel#3333) [SYCL] Restore old behavior of get() method (intel#3356) [Driver][SYCL][FPGA] Improve FPGA AOT when using Triple (intel#3330) [SYCL] Revert support for pinned_host_memory extension in Level-Zero backend. Make it a NOP (intel#3349) [SYCL] Remove redundant build options processing (intel#3342) [SYCL][NFC] Factor out GenXIntrinsics git repo tag. (intel#3351) [SYCL] Add coarse-grained debug aid for finding imbalance in Level-Zero alloc/free (intel#3334) [SYCL] Sub-group load/store for raw pointers (intel#3255) [SYCL] Fix more unused variables warnings (intel#3352) [BuildBot] Uplift CPU/FPGAEMU RT version for CI Process (intel#3338)
2 parents e9aa694 + dc82826 commit 07f3686

40 files changed

+1409
-413
lines changed

buildbot/dependency.conf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[VERSIONS]
2-
# https://github.com/intel/llvm/releases/download/2021-WW10/oclcpuexp-2021.11.3.0.02_rel.tar.gz
3-
ocl_cpu_rt_ver=2021.11.3.0.02
4-
# https://github.com/intel/llvm/releases/download/2021-WW10/win-oclcpuexp-2021.11.3.0.02_rel.zip
5-
ocl_cpu_rt_ver_win=2021.11.3.0.02
2+
# https://github.com/intel/llvm/releases/download/2021-WW11/oclcpuexp-2021.11.3.0.09_rel.tar.gz
3+
ocl_cpu_rt_ver=2021.11.3.0.09
4+
# https://github.com/intel/llvm/releases/download/2021-WW11/win-oclcpuexp-2021.11.3.0.09_rel.zip
5+
ocl_cpu_rt_ver_win=2021.11.3.0.09
66
# Same GPU driver supports Level Zero and OpenCL
77
# https://github.com/intel/compute-runtime/releases/tag/21.08.19096
88
ocl_gpu_rt_ver=21.08.19096
@@ -19,21 +19,21 @@ tbb_ver=2021.2.0.236
1919
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-win.zip
2020
tbb_ver_win=2021.2.0.221
2121

22-
# https://github.com/intel/llvm/releases/download/2021-WW10/fpgaemu-2021.11.3.0.02_rel.tar.gz
23-
ocl_fpga_emu_ver=2021.11.3.0.02
24-
# https://github.com/intel/llvm/releases/download/2021-WW10/win-fpgaemu-2021.11.3.0.02_rel.zip
25-
ocl_fpga_emu_ver_win=2021.11.3.0.02
26-
fpga_ver=20210205_000005
22+
# https://github.com/intel/llvm/releases/download/2021-WW11/fpgaemu-2021.11.3.0.09_rel.tar.gz
23+
ocl_fpga_emu_ver=2021.11.3.0.09
24+
# https://github.com/intel/llvm/releases/download/2021-WW11/win-fpgaemu-2021.11.3.0.09_rel.zip
25+
ocl_fpga_emu_ver_win=2021.11.3.0.09
26+
fpga_ver=20210205_000003
2727
fpga_ver_win=20210204_000003_signed_bom_fixed
2828
ocloc_ver_win=27.20.100.9168
2929

3030
[DRIVER VERSIONS]
31-
cpu_driver_lin=2021.11.3.0.02
32-
cpu_driver_win=2021.11.3.0.02
31+
cpu_driver_lin=2021.11.3.0.09
32+
cpu_driver_win=2021.11.3.0.09
3333
gpu_driver_lin=21.08.19096
3434
gpu_driver_win=27.20.100.9316
35-
fpga_driver_lin=2021.11.3.0.02
36-
fpga_driver_win=2021.11.3.0.02
35+
fpga_driver_lin=2021.11.3.0.09
36+
fpga_driver_win=2021.11.3.0.09
3737
# NVidia CUDA driver
3838
# TODO provide URL for CUDA driver
3939
nvidia_gpu_driver_lin=435.21

clang/lib/Driver/Driver.cpp

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,10 +2810,8 @@ bool Driver::checkForOffloadStaticLib(Compilation &C,
28102810
if (isStaticArchiveFile(OLArg) && hasOffloadSections(C, OLArg, Args)) {
28112811
// FPGA binaries with AOCX or AOCR sections are not considered fat
28122812
// static archives.
2813-
if (Args.hasArg(options::OPT_fintelfpga))
2814-
return !(hasFPGABinary(C, OLArg.str(), types::TY_FPGA_AOCR) ||
2815-
hasFPGABinary(C, OLArg.str(), types::TY_FPGA_AOCX));
2816-
return true;
2813+
return !(hasFPGABinary(C, OLArg.str(), types::TY_FPGA_AOCR) ||
2814+
hasFPGABinary(C, OLArg.str(), types::TY_FPGA_AOCX));
28172815
}
28182816
return false;
28192817
}
@@ -3877,11 +3875,12 @@ class OffloadingActionBuilder final {
38773875
ActionList FullSYCLLinkBinaryList;
38783876
bool SYCLDeviceLibLinked = false;
38793877
FullSYCLLinkBinaryList.push_back(DeviceLinkAction);
3880-
// If used without -fintelfpga, -fsycl-link is used to wrap device
3881-
// objects for future host link. Device libraries should be linked
3882-
// by default to resolve any undefined reference.
3883-
if (!Args.hasArg(options::OPT_fintelfpga)) {
3884-
const auto *TC = ToolChains.front();
3878+
// If used without the FPGA target, -fsycl-link is used to wrap
3879+
// device objects for future host link. Device libraries should
3880+
// be linked by default to resolve any undefined reference.
3881+
const auto *TC = ToolChains.front();
3882+
if (TC->getTriple().getSubArch() !=
3883+
llvm::Triple::SPIRSubArch_fpga) {
38853884
SYCLDeviceLibLinked =
38863885
addSYCLDeviceLibs(TC, FullSYCLLinkBinaryList, true,
38873886
C.getDefaultToolChain()
@@ -3984,8 +3983,9 @@ class OffloadingActionBuilder final {
39843983
return ABRT_Inactive;
39853984
// For SYCL device libraries, don't need to add them to
39863985
// FPGAObjectInputs as there is no FPGA dep files inside.
3987-
3988-
if (Args.hasArg(options::OPT_fintelfpga) &&
3986+
const auto *TC = ToolChains.front();
3987+
if (TC->getTriple().getSubArch() ==
3988+
llvm::Triple::SPIRSubArch_fpga &&
39893989
!IsSYCLDeviceLibObj(FileName, C.getDefaultToolChain()
39903990
.getTriple()
39913991
.isWindowsMSVCEnvironment()))
@@ -4332,7 +4332,7 @@ class OffloadingActionBuilder final {
43324332
BEInputs.push_back(UnbundleAction);
43334333
};
43344334
// Send any known objects/archives through the unbundler to grab the
4335-
// dependency file associated.
4335+
// dependency file associated. This is only done for -fintelfpga.
43364336
for (Action *A : FPGAObjectInputs)
43374337
unbundleAdd(A, types::TY_FPGA_Dependencies);
43384338
for (Action *A : FPGAArchiveInputs)
@@ -4460,11 +4460,6 @@ class OffloadingActionBuilder final {
44604460
// -fsycl-device-code-split=per_source
44614461
DeviceCodeSplit = DeviceCodeSplitArg &&
44624462
DeviceCodeSplitArg->getValue() != StringRef("off");
4463-
// Device only compilation for -fsycl-link (no FPGA) and
4464-
// -fsycl-link-targets
4465-
CompileDeviceOnly =
4466-
(SYCLLinkTargets ||
4467-
(WrapDeviceOnlyBinary && !Args.hasArg(options::OPT_fintelfpga)));
44684463
// Gather information about the SYCL Ahead of Time targets. The targets
44694464
// are determined on the SubArch values passed along in the triple.
44704465
Arg *SYCLTargets =
@@ -4519,14 +4514,19 @@ class OffloadingActionBuilder final {
45194514
SYCLfpgaTriple = true;
45204515
}
45214516

4517+
// Device only compilation for -fsycl-link (no FPGA) and
4518+
// -fsycl-link-targets
4519+
CompileDeviceOnly =
4520+
(SYCLLinkTargets || (WrapDeviceOnlyBinary && !SYCLfpgaTriple));
4521+
45224522
// Set the FPGA output type based on command line (-fsycl-link).
45234523
if (auto * A = C.getInputArgs().getLastArg(options::OPT_fsycl_link_EQ))
45244524
FPGAOutType = (A->getValue() == StringRef("early"))
45254525
? types::TY_FPGA_AOCR : types::TY_FPGA_AOCX;
45264526

45274527
// Populate FPGA static archives that could contain dep files to be
45284528
// incorporated into the aoc compilation
4529-
if (SYCLfpgaTriple) {
4529+
if (SYCLfpgaTriple && Args.hasArg(options::OPT_fintelfpga)) {
45304530
SmallVector<const char *, 16> LinkArgs(getLinkerArgs(C, Args));
45314531
for (StringRef LA : LinkArgs) {
45324532
if (isStaticArchiveFile(LA) && hasOffloadSections(C, LA, Args)) {
@@ -4685,6 +4685,7 @@ class OffloadingActionBuilder final {
46854685
// is a bundle or not and if the input is not a bundle it assumes it is a
46864686
// host file. Therefore it is safe to create an unbundling action even if
46874687
// the input is not a bundle.
4688+
bool HasFPGATarget = false;
46884689
if (CanUseBundler && isa<InputAction>(HostAction) &&
46894690
InputArg->getOption().getKind() == llvm::opt::Option::InputClass &&
46904691
!InputArg->getOption().hasFlag(options::LinkerInput) &&
@@ -4694,9 +4695,12 @@ class OffloadingActionBuilder final {
46944695
ActionList HostActionList;
46954696
Action *A(HostAction);
46964697
// Only check for FPGA device information when using fpga SubArch.
4697-
if (Args.hasArg(options::OPT_fintelfpga) &&
4698-
!(HostAction->getType() == types::TY_Object &&
4699-
isObjectFile(InputName))) {
4698+
auto SYCLTCRange = C.getOffloadToolChains<Action::OFK_SYCL>();
4699+
for (auto TI = SYCLTCRange.first, TE = SYCLTCRange.second; TI != TE; ++TI)
4700+
HasFPGATarget |= TI->second->getTriple().getSubArch() ==
4701+
llvm::Triple::SPIRSubArch_fpga;
4702+
if (HasFPGATarget && !(HostAction->getType() == types::TY_Object &&
4703+
isObjectFile(InputName))) {
47004704
// Type FPGA aoco is a special case for -foffload-static-lib.
47014705
if (HostAction->getType() == types::TY_FPGA_AOCO) {
47024706
if (!hasFPGABinary(C, InputName, types::TY_FPGA_AOCO))
@@ -4741,10 +4745,9 @@ class OffloadingActionBuilder final {
47414745
// For unbundling of an FPGA AOCX binary, we want to link with the original
47424746
// FPGA device archive.
47434747
if ((OffloadKind == Action::OFK_None && CanUseBundler) ||
4744-
(Args.hasArg(options::OPT_fintelfpga) &&
4745-
((Args.hasArg(options::OPT_fsycl_link_EQ) &&
4746-
HostAction->getType() == types::TY_Object) ||
4747-
HostAction->getType() == types::TY_FPGA_AOCX)))
4748+
(HasFPGATarget && ((Args.hasArg(options::OPT_fsycl_link_EQ) &&
4749+
HostAction->getType() == types::TY_Object) ||
4750+
HostAction->getType() == types::TY_FPGA_AOCX)))
47484751
if (auto *UA = dyn_cast<OffloadUnbundlingJobAction>(HostAction))
47494752
HostAction = UA->getInputs().back();
47504753

@@ -5187,13 +5190,13 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
51875190
// are then added to the appropriate device link actions and host list is
51885191
// ignored since we are adding offload-static-libs as normal libraries to
51895192
// the host link command.
5190-
if (hasOffloadSections(C, LA, Args))
5193+
if (hasOffloadSections(C, LA, Args)) {
51915194
unbundleStaticLib(types::TY_Archive, LA);
5192-
// Pass along the static libraries to check if we need to add them for
5193-
// unbundling for FPGA AOT static lib usage. Uses FPGA aoco type to
5194-
// differentiate if aoco unbundling is needed.
5195-
if (Args.hasArg(options::OPT_fintelfpga))
5195+
// Pass along the static libraries to check if we need to add them for
5196+
// unbundling for FPGA AOT static lib usage. Uses FPGA aoco type to
5197+
// differentiate if aoco unbundling is needed.
51965198
unbundleStaticLib(types::TY_FPGA_AOCO, LA);
5199+
}
51975200
}
51985201

51995202
// For an FPGA archive, we add the unbundling step above to take care of
@@ -6152,16 +6155,17 @@ InputInfo Driver::BuildJobsForActionNoCache(
61526155
// unbundling action does not change the type of the output which can
61536156
// cause a overwrite.
61546157
InputInfo CurI;
6155-
bool IsFPGAObjLink = (JA->getType() == types::TY_Object &&
6156-
C.getInputArgs().hasArg(options::OPT_fintelfpga) &&
6157-
C.getInputArgs().hasArg(options::OPT_fsycl_link_EQ));
6158+
bool IsFPGAObjLink =
6159+
(JA->getType() == types::TY_Object &&
6160+
EffectiveTriple.getSubArch() == llvm::Triple::SPIRSubArch_fpga &&
6161+
C.getInputArgs().hasArg(options::OPT_fsycl_link_EQ));
61586162
if (C.getDriver().getOffloadStaticLibSeen() &&
61596163
JA->getType() == types::TY_Archive) {
61606164
// Host part of the unbundled static archive is not used.
61616165
if (UI.DependentOffloadKind == Action::OFK_Host)
61626166
continue;
6163-
// Host part of the unbundled object when -fintelfpga -fsycl-link is
6164-
// enabled is not used
6167+
// Host part of the unbundled object is not used when using the
6168+
// FPGA target and -fsycl-link is enabled.
61656169
if (UI.DependentOffloadKind == Action::OFK_Host && IsFPGAObjLink)
61666170
continue;
61676171
std::string TmpFileName = C.getDriver().GetTemporaryPath(
@@ -6203,8 +6207,8 @@ InputInfo Driver::BuildJobsForActionNoCache(
62036207
C.addTempFile(C.getArgs().MakeArgString(TmpFileName));
62046208
CurI = InputInfo(TI, TmpFile, TmpFile);
62056209
} else {
6206-
// Host part of the unbundled object is not used when -fintelfpga
6207-
// -fsycl-link is enabled
6210+
// Host part of the unbundled object is not used when -fsycl-link is
6211+
// enabled with FPGA target
62086212
if (UI.DependentOffloadKind == Action::OFK_Host && IsFPGAObjLink)
62096213
continue;
62106214
std::string OffloadingPrefix = Action::GetOffloadingFileNamePrefix(

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
11051105
const InputInfo &Output,
11061106
const InputInfoList &Inputs) const {
11071107
const bool IsIAMCU = getToolChain().getTriple().isOSIAMCU();
1108+
const bool IsIntelFPGA = Args.hasArg(options::OPT_fintelfpga);
11081109

11091110
CheckPreprocessingOptions(D, Args);
11101111

@@ -1143,16 +1144,14 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
11431144
C.addFailureResultFile(DepFile, &JA);
11441145
// Populate the named dependency file to be used in the bundle
11451146
// or passed to the offline compilation.
1146-
if (Args.hasArg(options::OPT_fintelfpga) &&
1147-
JA.isDeviceOffloading(Action::OFK_SYCL))
1147+
if (IsIntelFPGA && JA.isDeviceOffloading(Action::OFK_SYCL))
11481148
C.getDriver().addFPGATempDepFile(
11491149
DepFile, Clang::getBaseInputName(Args, Inputs[0]));
11501150
} else if (Output.getType() == types::TY_Dependencies) {
11511151
DepFile = Output.getFilename();
11521152
} else if (!ArgMD) {
11531153
DepFile = "-";
1154-
} else if (Args.hasArg(options::OPT_fintelfpga) &&
1155-
JA.isDeviceOffloading(Action::OFK_SYCL)) {
1154+
} else if (IsIntelFPGA && JA.isDeviceOffloading(Action::OFK_SYCL)) {
11561155
createFPGATempDepFile(DepFile);
11571156
} else {
11581157
DepFile = getDependencyFileName(Args, Inputs);
@@ -1208,8 +1207,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
12081207
CmdArgs.push_back("-module-file-deps");
12091208
}
12101209

1211-
if (!ArgM && Args.hasArg(options::OPT_fintelfpga) &&
1212-
JA.isDeviceOffloading(Action::OFK_SYCL)) {
1210+
if (!ArgM && IsIntelFPGA && JA.isDeviceOffloading(Action::OFK_SYCL)) {
12131211
// No dep generation option was provided, add all of the needed options
12141212
// to ensure a successful dep generation.
12151213
const char *DepFile;
@@ -7686,9 +7684,12 @@ void OffloadBundler::ConstructJob(Compilation &C, const JobAction &JA,
76867684
Triples += CurDep->getOffloadingArch();
76877685
}
76887686
}
7689-
bool IsFPGADepBundle = (TCArgs.hasArg(options::OPT_fintelfpga) &&
7690-
Output.getType() == types::TY_Object);
7691-
// For -fintelfpga, when bundling objects we also want to bundle up the
7687+
// If we see we are bundling for FPGA using -fintelfpga, add the
7688+
// dependency bundle
7689+
bool IsFPGADepBundle = TCArgs.hasArg(options::OPT_fintelfpga) &&
7690+
Output.getType() == types::TY_Object;
7691+
7692+
// For spir64_fpga target, when bundling objects we also want to bundle up the
76927693
// named dependency file.
76937694
// TODO - We are currently using the target triple inputs to slot a location
76947695
// of the dependency information into the bundle. It would be good to

clang/test/Driver/sycl-intelfpga-static-lib-win.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@
3333
// RUN: | FileCheck -check-prefix=CHECK_UNBUNDLE %s
3434
// CHECK_UNBUNDLE: clang-offload-bundler" "-type=aoo" "-targets=sycl-fpga_dep" "-inputs={{.*}}" "-outputs=[[DEPFILES:.+\.txt]]" "-unbundle"
3535
// CHECK_UNBUNDLE: aoc{{.*}} "-dep-files=@[[DEPFILES]]"
36+
37+
/// Check for no unbundle and use of deps in static lib when using triple
38+
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %t.lib -### 2>&1 \
39+
// RUN: | FileCheck -check-prefix=CHECK_NO_UNBUNDLE %s
40+
// CHECK_NO_UNBUNDLE-NOT: clang-offload-bundler" "-type=aoo" "-targets=sycl-fpga_dep"
41+
// CHECK_NO_UNBUNDLE-NOT: aoc{{.*}} "-dep-files={{.*}}"

clang/test/Driver/sycl-intelfpga-static-lib.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@
3232
// RUN: | FileCheck -check-prefix=CHECK_UNBUNDLE %s
3333
// CHECK_UNBUNDLE: clang-offload-bundler" "-type=aoo" "-targets=sycl-fpga_dep" "-inputs={{.*}}" "-outputs=[[DEPFILES:.+\.txt]]" "-unbundle"
3434
// CHECK_UNBUNDLE: aoc{{.*}} "-dep-files=@[[DEPFILES]]"
35+
36+
/// Check for no unbundle and use of deps in static lib when using triple
37+
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %t.a -### 2>&1 \
38+
// RUN: | FileCheck -check-prefix=CHECK_NO_UNBUNDLE %s
39+
// CHECK_NO_UNBUNDLE-NOT: clang-offload-bundler" "-type=aoo" "-targets=sycl-fpga_dep"
40+
// CHECK_NO_UNBUNDLE-NOT: aoc{{.*}} "-dep-files={{.*}}"

clang/test/Driver/sycl-offload-intelfpga.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
/// Check SYCL headers path
77
// RUN: %clangxx -### -target x86_64-unknown-linux-gnu -fsycl -fintelfpga %s 2>&1 \
8+
// RUN: %clangxx -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 \
89
// RUN: | FileCheck -check-prefix=CHK-HEADERS-INTELFPGA %s
910
// CHK-HEADERS-INTELFPGA: clang{{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"
1011

clang/test/Driver/sycl-offload-with-split.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@
313313
// RUN: %clang -### -fsycl -fno-sycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
314314
// RUN: %clang_cl -### -fsycl -fno-sycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
315315
// RUN: %clang -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
316+
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
316317
// RUN: %clang_cl -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
317318
// CHK-ESIMD-SPLIT: sycl-post-link{{.*}} "-split-esimd"
318319
// CHK-NO-ESIMD-SPLIT-NOT: sycl-post-link{{.*}} "-split-esimd"
@@ -325,6 +326,7 @@
325326
// RUN: %clang -### -fsycl -fno-sycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
326327
// RUN: %clang_cl -### -fsycl -fno-sycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
327328
// RUN: %clang -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
329+
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
328330
// RUN: %clang_cl -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
329331
// CHK-ESIMD-LOWER: sycl-post-link{{.*}} "-lower-esimd"
330332
// CHK-NO-ESIMD-LOWER-NOT: sycl-post-link{{.*}} "-lower-esimd"

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,46 @@ add_custom_command(OUTPUT ${obj_binary_dir}/libsycl-fallback-cmath-fp64.${lib-su
167167
DEPENDS device_math.h device.h clang clang-offload-bundler
168168
VERBATIM)
169169

170+
add_custom_command(OUTPUT ${obj_binary_dir}/libsycl-itt-stubs.${lib-suffix}
171+
COMMAND ${clang} -fsycl -c
172+
${compile_opts} ${sycl_targets_opt}
173+
${CMAKE_CURRENT_SOURCE_DIR}/itt_stubs.cpp
174+
-o ${obj_binary_dir}/libsycl-itt-stubs.${lib-suffix}
175+
MAIN_DEPENDENCY itt_stubs.cpp
176+
DEPENDS device_itt.h spirv_vars.h device.h clang clang-offload-bundler
177+
VERBATIM)
178+
179+
add_custom_command(OUTPUT ${obj_binary_dir}/libsycl-itt-compiler-wrappers.${lib-suffix}
180+
COMMAND ${clang} -fsycl -c
181+
${compile_opts} ${sycl_targets_opt}
182+
${CMAKE_CURRENT_SOURCE_DIR}/itt_compiler_wrappers.cpp
183+
-o ${obj_binary_dir}/libsycl-itt-compiler-wrappers.${lib-suffix}
184+
MAIN_DEPENDENCY itt_compiler_wrappers.cpp
185+
DEPENDS device_itt.h spirv_vars.h device.h clang clang-offload-bundler
186+
VERBATIM)
187+
188+
add_custom_command(OUTPUT ${obj_binary_dir}/libsycl-itt-user-wrappers.${lib-suffix}
189+
COMMAND ${clang} -fsycl -c
190+
${compile_opts} ${sycl_targets_opt}
191+
${CMAKE_CURRENT_SOURCE_DIR}/itt_user_wrappers.cpp
192+
-o ${obj_binary_dir}/libsycl-itt-user-wrappers.${lib-suffix}
193+
MAIN_DEPENDENCY itt_user_wrappers.cpp
194+
DEPENDS device_itt.h spirv_vars.h device.h clang clang-offload-bundler
195+
VERBATIM)
196+
197+
set(devicelib-obj-itt-files
198+
${obj_binary_dir}/libsycl-itt-stubs.${lib-suffix}
199+
${obj_binary_dir}/libsycl-itt-compiler-wrappers.${lib-suffix}
200+
${obj_binary_dir}/libsycl-itt-user-wrappers.${lib-suffix}
201+
)
202+
170203
add_custom_target(libsycldevice-obj DEPENDS
171204
${devicelib-obj-file}
172205
${devicelib-obj-complex}
173206
${devicelib-obj-complex-fp64}
174207
${devicelib-obj-cmath}
175208
${devicelib-obj-cmath-fp64}
209+
${devicelib-obj-itt-files}
176210
)
177211
add_custom_target(libsycldevice-spv DEPENDS
178212
${spv_binary_dir}/libsycl-fallback-cassert.spv
@@ -212,7 +246,8 @@ install(FILES ${devicelib-obj-file}
212246
${devicelib-obj-cmath}
213247
${obj_binary_dir}/libsycl-fallback-cmath.${lib-suffix}
214248
${devicelib-obj-cmath-fp64}
215-
${obj_binary_dir}/libsycl-fallback-cmath-fp64.${lib-suffix}
249+
${obj_binary_dir}/libsycl-fallback-cmath-fp64.${lib-suffix}
250+
${devicelib-obj-itt-files}
216251
DESTINATION ${install_dest_lib}
217252
COMPONENT libsycldevice)
218253

0 commit comments

Comments
 (0)