Skip to content

Commit f56b784

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into llvmspirv_pulldown
Conflicts: libclc/CMakeLists.txt libclc/clc/include/clc/clcfunc.h libclc/generic/include/clc/clc.h libclc/libspirv/include/libspirv/spirv.h
2 parents 90af614 + 81a48a6 commit f56b784

File tree

507 files changed

+10239
-17553
lines changed

Some content is hidden

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

507 files changed

+10239
-17553
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ sycl/doc/syclgraph/ @intel/sycl-graphs-reviewers
177177
sycl/**/syclcompat/ @intel/syclcompat-lib-reviewers
178178
sycl/cmake/modules/AddSYCLLibraryUnitTest.cmake @intel/syclcompat-lib-reviewers
179179
sycl/include/syclcompat.hpp @intel/syclcompat-lib-reviewers
180+
sycl/test-e2e/syclcompat/ @intel/syclcompat-lib-reviewers
180181

181182
# bindless images
182183
sycl/doc/extensions/experimental/sycl_ext_oneapi_bindless_images.asciidoc @intel/bindless-images-reviewers

.github/workflows/sycl-containers-igc-dev.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
paths:
88
- 'devops/actions/build_container/**'
99
- 'devops/scripts/**'
10+
- '!devops/scripts/benchmarks/**'
1011
- 'devops/dependencies-igc-dev.json'
1112
- '.github/workflows/sycl-containers-igc-dev.yaml'
1213
pull_request:
1314
paths:
1415
- 'devops/actions/build_container/**'
1516
- 'devops/scripts/**'
17+
- '!devops/scripts/benchmarks/**'
1618
- 'devops/dependencies-igc-dev.json'
1719
- '.github/workflows/sycl-containers-igc-dev.yaml'
1820

.github/workflows/sycl-linux-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ on:
3232
build_artifact_suffix:
3333
type: string
3434
required: true
35+
build_target:
36+
type: string
37+
required: false
38+
default: sycl-toolchain
3539
artifact_archive_name:
3640
type: string
3741
default: llvm_sycl.tar.zst
@@ -177,7 +181,8 @@ jobs:
177181
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
178182
- name: Compile
179183
id: build
180-
run: cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain
184+
# Emulate default value for manual dispatch as we've run out of available arguments.
185+
run: cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }}
181186
- name: check-llvm
182187
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
183188
run: |

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ jobs:
321321
- name: Run SYCL CTS Tests
322322
if: inputs.tests_selector == 'cts'
323323
uses: ./devops/actions/run-tests/cts
324+
# Normally this job takes less than 10m. But sometimes it hangs up and
325+
# reaches the 360m limit. Set a lower limit to free up the runner earlier.
326+
timeout-minutes: 35
324327
with:
325328
ref: ${{ inputs.tests_ref || 'main' }}
326329
cts_exclude_ref: ${{ inputs.repo_ref }}

.github/workflows/sycl-nightly.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
build_cache_suffix: sprod_shared
3434
build_artifact_suffix: sprod_shared
3535
build_configure_extra_args: '--shared-libs --hip --cuda --native_cpu --no-assertions'
36+
build_target: all
3637

3738
artifact_archive_name: sycl_linux_shared.tar.zst
3839

@@ -151,6 +152,7 @@ jobs:
151152
artifact_archive_name: sycl_windows.tar.gz
152153
# Disable the spirv-dis requirement as to not require SPIR-V Tools.
153154
build_configure_extra_args: -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off
155+
build_target: all
154156

155157
e2e-win:
156158
needs: build-win
@@ -217,9 +219,6 @@ jobs:
217219
run-sycl-cts-linux:
218220
needs: [ubuntu2204_build, build-sycl-cts-linux]
219221
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
220-
# Normally these jobs take less than 10m. But sometimes the job hangs up and
221-
# reaches the 360m limit. Set a lower limit to free up the runner earlier.
222-
timeout-minutes: 35
223222
strategy:
224223
fail-fast: false
225224
matrix:

.github/workflows/sycl-windows-build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
build_configure_extra_args:
1111
type: string
1212
required: false
13+
build_target:
14+
type: string
15+
required: false
16+
default: sycl-toolchain
1317
changes:
1418
type: string
1519
description: 'Filter matches for the changed files in the PR'
@@ -58,6 +62,11 @@ on:
5862
build_configure_extra_args:
5963
type: string
6064
required: false
65+
build_target:
66+
type: choice
67+
options:
68+
- "sycl-toolchain"
69+
- "all"
6170
artifact_archive_name:
6271
type: choice
6372
options:
@@ -143,7 +152,7 @@ jobs:
143152
id: build
144153
shell: bash
145154
run: |
146-
cmake --build build --target sycl-toolchain
155+
cmake --build build --target ${{ inputs.build_target }}
147156
- name: check-llvm
148157
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
149158
shell: bash

.github/workflows/ur-build-hw.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ jobs:
144144
-DUR_DEVELOPER_MODE=ON
145145
-DUR_BUILD_TESTS=ON
146146
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
147-
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
148147
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
149148
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
150149
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
@@ -165,14 +164,16 @@ jobs:
165164
- name: Test adapter specific
166165
env:
167166
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
168-
run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV
167+
LIT_OPTS: "--timeout 120 --filter-out 'adapters/level_zero/memcheck.test'"
168+
run: cmake --build build -j $(nproc) -- check-unified-runtime-adapter
169169
# Don't run adapter specific tests when building multiple adapters
170170
if: ${{ matrix.adapter.other_name == '' }}
171171

172172
- name: Test adapters
173173
env:
174174
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
175-
run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "conformance" --timeout 600 -VV
175+
LIT_OPTS: "--timeout 120"
176+
run: cmake --build build -j $(nproc) -- check-unified-runtime-conformance
176177

177178
- name: Get information about platform
178179
if: ${{ always() }}

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,12 +1637,14 @@ def SYCLType: InheritableAttr {
16371637
let Subjects = SubjectList<[CXXRecord, Enum], ErrorDiag>;
16381638
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
16391639
let Args = [EnumArgument<"Type", "SYCLType", /*is_string=*/true,
1640-
["accessor", "local_accessor", "work_group_memory", "dynamic_work_group_memory",
1640+
["accessor", "local_accessor", "dynamic_local_accessor",
1641+
"work_group_memory", "dynamic_work_group_memory",
16411642
"specialization_id", "kernel_handler", "buffer_location",
16421643
"no_alias", "accessor_property_list", "group",
16431644
"private_memory", "aspect", "annotated_ptr", "annotated_arg",
16441645
"stream", "sampler", "host_pipe", "multi_ptr"],
1645-
["accessor", "local_accessor", "work_group_memory", "dynamic_work_group_memory",
1646+
["accessor", "local_accessor", "dynamic_local_accessor",
1647+
"work_group_memory", "dynamic_work_group_memory",
16461648
"specialization_id", "kernel_handler", "buffer_location",
16471649
"no_alias", "accessor_property_list", "group",
16481650
"private_memory", "aspect", "annotated_ptr", "annotated_arg",

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ def warn_drv_unsupported_option_for_offload_arch_req_feature : Warning<
142142
"ignoring '%0' option for offload arch '%1' as it is not currently supported "
143143
"there. Use it with an offload arch containing '%2' instead">,
144144
InGroup<OptionIgnored>;
145-
def warn_drv_unsupported_option_for_target : Warning<
146-
"ignoring '%0' option as it is not currently supported for target '%1'">,
147-
InGroup<OptionIgnored>;
145+
def warn_drv_unsupported_option_for_target
146+
: Warning<"ignoring '%0' option as it is not currently supported for "
147+
"target '%1'%select{|; only supported for host compilation}2">,
148+
InGroup<OptionIgnored>;
148149
def warn_drv_unsupported_option_for_flang : Warning<
149150
"the argument '%0' is not supported for option '%1'. Mapping to '%1%2'">,
150151
InGroup<OptionIgnored>;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12928,7 +12928,8 @@ def err_free_function_variadic_args : Error<
1292812928
"free function kernel cannot be a variadic function">;
1292912929
def err_free_function_return_type : Error<
1293012930
"SYCL free function kernel should have return type 'void'">;
12931-
12931+
def err_free_function_first_occurrence_missing_attr: Error<
12932+
"the first occurrence of SYCL kernel free function should be declared with 'sycl-nd-range-kernel' or 'sycl-single-task-kernel' compile time properties">;
1293212933

1293312934
// SYCL kernel entry point diagnostics
1293412935
def err_sycl_entry_point_invalid : Error<

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7351,8 +7351,10 @@ defm sycl_allow_device_image_dependencies: BoolOptionWithoutMarshalling<"f", "sy
73517351
def fsycl_dump_device_code_EQ : Joined<["-"], "fsycl-dump-device-code=">,
73527352
Flags<[NoXarchOption]>,
73537353
HelpText<"Dump device code into the user provided directory.">;
7354-
def fsyclbin : Flag<["-"], "fsyclbin">,
7355-
HelpText<"Create a SYCLBIN file">;
7354+
def fsyclbin_EQ : Joined<["-"], "fsyclbin=">, Values<"executable,object,input">,
7355+
HelpText<"Output in the SYCLBIN binary format in the state specified by <arg> (input, object or executable (default))">;
7356+
def fsyclbin : Flag<["-"], "fsyclbin">, Alias<fsyclbin_EQ>,
7357+
AliasArgs<["executable"]>;
73567358
} // let Group = sycl_Group
73577359

73587360
// FIXME: -fsycl-explicit-simd is deprecated. remove it when support is dropped.

clang/include/clang/Sema/SemaSYCL.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class SYCLIntegrationHeader {
6464
kind_stream,
6565
kind_work_group_memory,
6666
kind_dynamic_work_group_memory,
67-
kind_last = kind_dynamic_work_group_memory
67+
kind_dynamic_accessor,
68+
kind_last = kind_dynamic_accessor
6869
};
6970

7071
public:

clang/lib/Driver/Driver.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12311231
bool IsSYCL = C.getInputArgs().hasFlag(options::OPT_fsycl,
12321232
options::OPT_fno_sycl, false) ||
12331233
C.getInputArgs().hasArgNoClaim(options::OPT_fsycl_device_only,
1234-
options::OPT_fsyclbin);
1234+
options::OPT_fsyclbin_EQ);
12351235

12361236
auto argSYCLIncompatible = [&](OptSpecifier OptId) {
12371237
if (!IsSYCL)
@@ -1566,7 +1566,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
15661566
continue;
15671567
}
15681568
Diag(diag::warn_drv_unsupported_option_for_target)
1569-
<< "-fno-sycl-libspirv" << TT.getTriple();
1569+
<< "-fno-sycl-libspirv" << TT.getTriple() << 0;
15701570
}
15711571
}
15721572
// -fsycl-fp64-conv-emu is valid only for AOT compilation with an Intel GPU
@@ -3471,7 +3471,8 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
34713471
Arg *InputTypeArg = nullptr;
34723472
bool IsSYCL =
34733473
Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false) ||
3474-
Args.hasArgNoClaim(options::OPT_fsycl_device_only, options::OPT_fsyclbin);
3474+
Args.hasArgNoClaim(options::OPT_fsycl_device_only,
3475+
options::OPT_fsyclbin_EQ);
34753476

34763477
// The last /TC or /TP option sets the input type to C or C++ globally.
34773478
if (Arg *TCTP = Args.getLastArgNoClaim(options::OPT__SLASH_TC,
@@ -7959,7 +7960,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
79597960
DDep.add(*FatbinAction, *C.getSingleOffloadToolChain<Action::OFK_HIP>(),
79607961
nullptr, Action::OFK_HIP);
79617962
} else if (C.isOffloadingHostKind(Action::OFK_SYCL) &&
7962-
Args.hasArg(options::OPT_fsyclbin)) {
7963+
Args.hasArg(options::OPT_fsyclbin_EQ)) {
79637964
// With '-fsyclbin', package all the offloading actions into a single output
79647965
// that is sent to the clang-linker-wrapper.
79657966
Action *PackagerAction =
@@ -9384,7 +9385,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
93849385
return C.addResultFile(FinalOutput->getValue(), &JA);
93859386
// Output to destination for -fsycl-device-only/-fsyclbin and Windows -o
93869387
if ((offloadDeviceOnly() ||
9387-
C.getArgs().hasArgNoClaim(options::OPT_fsyclbin)) &&
9388+
C.getArgs().hasArgNoClaim(options::OPT_fsyclbin_EQ)) &&
93889389
JA.getOffloadingDeviceKind() == Action::OFK_SYCL)
93899390
if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT__SLASH_o))
93909391
return C.addResultFile(FinalOutput->getValue(), &JA);
@@ -9558,7 +9559,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
95589559
// resulting image. A '.syclbin' extension is used to represent the resulting
95599560
// output file.
95609561
if (JA.getOffloadingDeviceKind() == Action::OFK_SYCL &&
9561-
C.getArgs().hasArgNoClaim(options::OPT_fsyclbin) &&
9562+
C.getArgs().hasArgNoClaim(options::OPT_fsyclbin_EQ) &&
95629563
JA.getType() == types::TY_Image) {
95639564
SmallString<128> SYCLBinOutput(getDefaultImageName());
95649565
if (IsCLMode())

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
13391339

13401340
if (!SanitizeArg.empty())
13411341
TC.getDriver().Diag(diag::warn_drv_unsupported_option_for_target)
1342-
<< SanitizeArg << TC.getTripleString();
1342+
<< SanitizeArg << TC.getTripleString() << 0;
13431343
#endif
13441344
return;
13451345
}

clang/lib/Driver/ToolChains/AMDGPU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class LLVM_LIBRARY_VISIBILITY ROCMToolChain : public AMDGPUToolChain {
164164
parseSanitizerValue(A->getValue(), /*Allow Groups*/ false);
165165
if (K != SanitizerKind::Address)
166166
Diags.Report(clang::diag::warn_drv_unsupported_option_for_target)
167-
<< A->getAsString(Args) << getTriple().str();
167+
<< A->getAsString(Args) << getTriple().str() << 0;
168168
}
169169
}
170170
};

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3860,7 +3860,7 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
38603860

38613861
if (EffectiveTriple.isBPF() && StackProtectorLevel != LangOptions::SSPOff) {
38623862
D.Diag(diag::warn_drv_unsupported_option_for_target)
3863-
<< A->getSpelling() << EffectiveTriple.getTriple();
3863+
<< A->getSpelling() << EffectiveTriple.getTriple() << 0;
38643864
StackProtectorLevel = DefaultStackProtectorLevel;
38653865
}
38663866
} else {
@@ -5750,10 +5750,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57505750
CmdArgs.push_back("-Wno-sycl-strict");
57515751
}
57525752

5753-
// Set O2 optimization level by default
5754-
if (!Args.getLastArg(options::OPT_O_Group))
5755-
CmdArgs.push_back("-O2");
5756-
57575753
// Add the integration header option to generate the header.
57585754
StringRef Header(D.getIntegrationHeader(Input.getBaseInput()));
57595755
if (!Header.empty()) {
@@ -11530,8 +11526,9 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1153011526
Args.MakeArgString("--sycl-target-link-options=" + LinkOptString));
1153111527
}
1153211528
// Add option to enable creating of the .syclbin file.
11533-
if (Args.hasArg(options::OPT_fsyclbin))
11534-
CmdArgs.push_back(Args.MakeArgString("--syclbin"));
11529+
if (Arg *A = Args.getLastArg(options::OPT_fsyclbin_EQ))
11530+
CmdArgs.push_back(
11531+
Args.MakeArgString("--syclbin=" + StringRef{A->getValue()}));
1153511532
}
1153611533

1153711534
// Construct the link job so we can wrap around it.

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,8 @@ void CudaToolChain::addClangTargetOptions(
966966
if (FastRelaxedMath || UnsafeMathOpt)
967967
CC1Args.append({"-mllvm", "--nvptx-prec-divf32=0", "-mllvm",
968968
"--nvptx-prec-sqrtf32=0"});
969+
970+
CC1Args.append({"-mllvm", "-enable-memcpyopt-without-libcalls"});
969971
} else {
970972
CC1Args.append({"-fcuda-is-device", "-mllvm",
971973
"-enable-memcpyopt-without-libcalls",

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,7 @@ static ArrayRef<options::ID> getUnsupportedOpts() {
14721472
options::OPT_fprofile_instr_use_EQ, // -fprofile-instr-use
14731473
options::OPT_fcs_profile_generate, // -fcs-profile-generate
14741474
options::OPT_fcs_profile_generate_EQ,
1475+
options::OPT_gline_tables_only, // -gline-tables-only
14751476
};
14761477
return UnsupportedOpts;
14771478
}
@@ -1517,7 +1518,7 @@ SYCLToolChain::SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
15171518
continue;
15181519
}
15191520
D.Diag(clang::diag::warn_drv_unsupported_option_for_target)
1520-
<< A->getAsString(Args) << getTriple().str();
1521+
<< A->getAsString(Args) << getTriple().str() << 1;
15211522
}
15221523
}
15231524
}

0 commit comments

Comments
 (0)