Skip to content

Commit 424eeac

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into private/dvodopya/update-oneapi-and-intel-extensions
2 parents 3fbc2d2 + a418e1c commit 424eeac

File tree

68 files changed

+831
-4187
lines changed

Some content is hidden

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

68 files changed

+831
-4187
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ There are 3 types of tests which are used for DPC++ toolchain validation:
6666
should not have hardware (e.g. GPU, FPGA, etc.) or external software
6767
dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following
6868
this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
69-
However, the tests for a feature under active development requiring atomic
70-
change for tests and product can be put to
71-
[sycl/test/on-device](../../sycl/test/on-device) temporarily. It is developer
72-
responsibility to move the tests to DPC++ E2E test suite or SYCL-CTS once
73-
the feature is stabilized.
7469

7570
**Guidelines for adding DPC++ in-tree LIT tests (DPC++ Clang FE tests)**:
7671
- Use `sycl::` namespace instead of `cl::sycl::`

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,14 +2628,6 @@ def fsycl_device_code_split_EQ : Joined<["-"], "fsycl-device-code-split=">,
26282628
def fsycl_device_code_split : Flag<["-"], "fsycl-device-code-split">, Alias<fsycl_device_code_split_EQ>,
26292629
AliasArgs<["auto"]>, Flags<[CC1Option, CoreOption]>,
26302630
HelpText<"Perform SYCL device code split in the 'auto' mode, i.e. use heuristic to distribute device code across modules">;
2631-
def fsycl_device_code_split_esimd : Flag<["-"], "fsycl-device-code-split-esimd">,
2632-
Flags<[CC1Option, CoreOption]>, HelpText<"Split SYCL and ESIMD kernels into separate modules">;
2633-
def fno_sycl_device_code_split_esimd : Flag<["-"], "fno-sycl-device-code-split-esimd">,
2634-
Flags<[CC1Option, CoreOption]>, HelpText<"Don't split SYCL and ESIMD kernels into separate modules">;
2635-
def fsycl_device_code_lower_esimd : Flag<["-"], "fsycl-device-code-lower-esimd">,
2636-
Flags<[CC1Option, CoreOption]>, HelpText<"Lower ESIMD-specific constructs">;
2637-
def fno_sycl_device_code_lower_esimd : Flag<["-"], "fno-sycl-device-code-lower-esimd">,
2638-
Flags<[CC1Option, CoreOption]>, HelpText<"Do not lower ESIMD-specific constructs">;
26392631
def fsycl_instrument_device_code : Flag<["-"], "fsycl-instrument-device-code">,
26402632
Group<sycl_Group>, Flags<[CC1Option, CoreOption]>,
26412633
HelpText<"Add ITT instrumentation intrinsics calls">,

clang/lib/Driver/Driver.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,6 +2932,18 @@ bool Driver::checkForSYCLDefaultDevice(Compilation &C,
29322932
if (Args.hasArg(options::OPT_fno_sycl_link_spirv))
29332933
return false;
29342934

2935+
// Do not do the check if the default device is passed in -fsycl-targets
2936+
// or if -fsycl-targets isn't passed (that implies default device)
2937+
if (const Arg *A = Args.getLastArg(options::OPT_fsycl_targets_EQ)) {
2938+
for (const char *Val : A->getValues()) {
2939+
llvm::Triple TT(C.getDriver().MakeSYCLDeviceTriple(Val));
2940+
if (TT.isSPIR() && TT.getSubArch() == llvm::Triple::NoSubArch)
2941+
// Default triple found
2942+
return false;
2943+
}
2944+
} else if (!Args.hasArg(options::OPT_fintelfpga))
2945+
return false;
2946+
29352947
SmallVector<const char *, 16> AllArgs(getLinkerArgs(C, Args, true));
29362948
for (StringRef Arg : AllArgs) {
29372949
if (hasSYCLDefaultSection(C, Arg))

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8774,7 +8774,7 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
87748774
ExtArg += ",+SPV_INTEL_usm_storage_classes";
87758775
else
87768776
// Don't enable several freshly added extensions on FPGA H/W
8777-
ExtArg += ",+SPV_INTEL_token_type";
8777+
ExtArg += ",+SPV_INTEL_token_type,+SPV_INTEL_bfloat16_conversion";
87788778
TranslatorArgs.push_back(TCArgs.MakeArgString(ExtArg));
87798779
}
87808780
for (auto I : Inputs) {
@@ -8945,13 +8945,8 @@ void SYCLPostLink::ConstructJob(Compilation &C, const JobAction &JA,
89458945
// Symbol file and specialization constant info generation is mandatory -
89468946
// add options unconditionally
89478947
addArgs(CmdArgs, TCArgs, {"-symbols"});
8948-
// By default we split SYCL and ESIMD kernels into separate modules
8949-
if (TCArgs.hasFlag(options::OPT_fsycl_device_code_split_esimd,
8950-
options::OPT_fno_sycl_device_code_split_esimd, true))
8951-
addArgs(CmdArgs, TCArgs, {"-split-esimd"});
8952-
if (TCArgs.hasFlag(options::OPT_fsycl_device_code_lower_esimd,
8953-
options::OPT_fno_sycl_device_code_lower_esimd, true))
8954-
addArgs(CmdArgs, TCArgs, {"-lower-esimd"});
8948+
addArgs(CmdArgs, TCArgs, {"-split-esimd"});
8949+
addArgs(CmdArgs, TCArgs, {"-lower-esimd"});
89558950
}
89568951
addArgs(CmdArgs, TCArgs,
89578952
{StringRef(getSYCLPostLinkOptimizationLevel(TCArgs))});

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -299,25 +299,15 @@
299299
// Check ESIMD device code split.
300300
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
301301
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
302-
// RUN: %clang -### -fsycl -fsycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
303-
// RUN: %clang_cl -### -fsycl -fsycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
304-
// RUN: %clang -### -fsycl -fno-sycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
305-
// RUN: %clang_cl -### -fsycl -fno-sycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
306302
// RUN: %clang -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
307303
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
308304
// RUN: %clang_cl -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
309305
// CHK-ESIMD-SPLIT: sycl-post-link{{.*}} "-split-esimd"
310-
// CHK-NO-ESIMD-SPLIT-NOT: sycl-post-link{{.*}} "-split-esimd"
311306

312307
// Check lowering of ESIMD device code.
313308
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
314309
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
315-
// RUN: %clang -### -fsycl -fsycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
316-
// RUN: %clang_cl -### -fsycl -fsycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
317-
// RUN: %clang -### -fsycl -fno-sycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
318-
// RUN: %clang_cl -### -fsycl -fno-sycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
319310
// RUN: %clang -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
320311
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
321312
// RUN: %clang_cl -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
322313
// CHK-ESIMD-LOWER: sycl-post-link{{.*}} "-lower-esimd"
323-
// CHK-NO-ESIMD-LOWER-NOT: sycl-post-link{{.*}} "-lower-esimd"

clang/test/Driver/sycl-offload.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,10 @@
9696
// RUN: | FileCheck -check-prefix NO_IMPLIED_DEVICE %s
9797
// NO_IMPLIED_DEVICE: clang-offload-bundler{{.*}} "-type=o" "-targets=sycl-spir64-unknown-unknown-sycldevice"{{.*}} "-check-section"
9898
// NO_IMPLIED_DEVICE-NOT: clang-offload-bundler{{.*}} "-targets={{.*}}spir64-unknown-unknown-sycldevice{{.*}}" "-unbundle"
99+
100+
/// Passing in the default triple should allow for -Xsycl-target options
101+
// RUN: %clangxx -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64 -Xsycl-target-backend=spir64 -DFOO -Xsycl-target-linker=spir64 -DFOO2 %S/Inputs/SYCL/objlin64.o 2>&1 \
102+
// RUN: | FileCheck -check-prefixes=SYCL_TARGET_OPT %s
103+
// RUN: %clangxx -### -target x86_64-unknown-linux-gnu -fsycl -Xsycl-target-backend=spir64 -DFOO -Xsycl-target-linker=spir64 -DFOO2 %S/Inputs/SYCL/objlin64.o 2>&1 \
104+
// RUN: | FileCheck -check-prefixes=SYCL_TARGET_OPT %s
105+
// SYCL_TARGET_OPT: clang-offload-wrapper{{.*}} "-compile-opts=-DFOO" "-link-opts=-DFOO2"

clang/test/Driver/sycl-spirv-ext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
// CHECK-DEFAULT-SAME:,+SPV_INTEL_fpga_dsp_control
5151
// CHECK-DEFAULT-SAME:,+SPV_INTEL_arithmetic_fence
5252
// CHECK-DEFAULT-SAME:,+SPV_INTEL_runtime_aligned
53-
// CHECK-DEFAULT-SAME:,+SPV_INTEL_token_type"
53+
// CHECK-DEFAULT-SAME:,+SPV_INTEL_token_type
54+
// CHECK-DEFAULT-SAME:,+SPV_INTEL_bfloat16_conversion"
5455
// CHECK-FPGA-HW: llvm-spirv{{.*}}"-spirv-ext=-all
5556
// CHECK-FPGA-HW-SAME:,+SPV_EXT_shader_atomic_float_add
5657
// CHECK-FPGA-HW-SAME:,+SPV_EXT_shader_atomic_float_min_max

0 commit comments

Comments
 (0)