Skip to content

Commit f166142

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (19 commits)
2 parents 32ef39e + 02372e4 commit f166142

File tree

44 files changed

+482
-280
lines changed

Some content is hidden

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

44 files changed

+482
-280
lines changed

.github/workflows/sycl-containers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ permissions: read-all
2828
jobs:
2929
build_and_push_images:
3030
if: github.repository == 'intel/llvm'
31-
name: Build and Push Docker Images
31+
name: "Containers"
3232
runs-on: ubuntu-latest
3333
permissions:
3434
packages: write

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,18 +189,22 @@ jobs:
189189
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
190190
extra_lit_opts: --param test-preview-mode=True
191191
binaries_artifact: e2e_bin_preview
192+
193+
# We're in an ABI-breaking window, so these don't make sense for now.
192194
- name: ABI compatibility / sycl-rel-6_2
193195
runner: '["Linux", "pvc"]'
194196
image: ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_2
195197
target_devices: level_zero:gpu
196198
extra_lit_opts: '--param test-preview-mode=False --filter-out "${{ needs.compat_read_exclude.outputs.FILTER_6_2 }}"'
197199
binaries_artifact: 'in-container'
200+
skip_run: true
198201
- name: ABI compatibility / sycl-rel-6_3
199202
runner: '["Linux", "pvc"]'
200203
image: ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_3
201204
target_devices: level_zero:gpu
202205
extra_lit_opts: '--param test-preview-mode=False --filter-out "${{ needs.compat_read_exclude.outputs.FILTER_6_3 }}"'
203206
binaries_artifact: 'in-container'
207+
skip_run: true
204208

205209
uses: ./.github/workflows/sycl-linux-run-tests.yml
206210
with:
@@ -229,7 +233,7 @@ jobs:
229233
(contains(needs.detect_changes.outputs.filters, 'devigccfg') || contains(needs.detect_changes.outputs.filters, 'drivers')) ||
230234
'false' }}
231235
# Run only if the PR does not have the 'ci-no-devigc' label.
232-
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
236+
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || matrix.skip_run || 'false'}}
233237
env: ${{ matrix.env || (contains(needs.detect_changes.outputs.filters, 'esimd') && '{}' || '{"LIT_FILTER_OUT":"ESIMD/"}') }}
234238

235239
test-perf:

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ on:
135135
default: 'false'
136136
required: False
137137

138+
in_workflow_call_mode:
139+
description: |
140+
Unlike `github.event_type` that captures the original trigger, we use
141+
this to determine how this particular workflow has been called. This
142+
isn't supposed to be specified by a caller and only relies on the
143+
default value.
144+
default: 'true'
145+
required: False
146+
type: string
147+
138148
workflow_dispatch:
139149
inputs:
140150
runner:
@@ -332,7 +342,9 @@ jobs:
332342
timeout-minutes: 60
333343
with:
334344
ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }}
335-
binaries_artifact: ${{ inputs.binaries_artifact }}
345+
binaries_artifact: ${{ inputs.in_workflow_call_mode && inputs.binaries_artifact
346+
|| inputs.testing_mode == 'run-only' && 'in-container'
347+
|| '' }}
336348
testing_mode: ${{ inputs.testing_mode }}
337349
extra_cmake_args: ${{ inputs.extra_cmake_args }}
338350
target_devices: ${{ inputs.target_devices }}
@@ -349,7 +361,9 @@ jobs:
349361
ref: ${{ inputs.tests_ref || 'main' }}
350362
extra_cmake_args: ${{ inputs.extra_cmake_args }}
351363
testing_mode: ${{ inputs.testing_mode }}
352-
binaries_artifact: ${{ inputs.binaries_artifact }}
364+
binaries_artifact: ${{ inputs.in_workflow_call_mode && inputs.binaries_artifact
365+
|| inputs.testing_mode == 'run-only' && 'in-container'
366+
|| '' }}
353367
target_devices: ${{ inputs.target_devices }}
354368
retention-days: ${{ inputs.retention-days }}
355369

.github/workflows/sycl-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ jobs:
368368
with:
369369
name: sycl_windows_default
370370
- name: Sign with sigstore/cosign
371-
uses: sigstore/[email protected]
371+
uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
372372
with:
373373
inputs: sycl_linux.tar.gz sycl_windows.tar.gz
374374
- name: Compute tag
@@ -381,7 +381,7 @@ jobs:
381381
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
382382
fi
383383
- name: Upload binaries
384-
uses: softprops/[email protected]
384+
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
385385
with:
386386
files: |
387387
sycl_linux.tar.gz

.github/workflows/sycl-zizmor.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Zizmor
33
on:
44
workflow_dispatch:
55
push:
6+
branches:
7+
- sycl
68
# Although workflow files (.yml) should only be placed in the
79
# .github/workflows directory, composite actions may be placed anywhere.
810
# Here in intel/llvm composite actions are placed in the devops/actions
@@ -13,6 +15,12 @@ on:
1315
paths:
1416
- '.github/workflows/**/*.yml'
1517
- 'devops/actions/**/*.yml'
18+
pull_request:
19+
branches:
20+
- sycl
21+
paths:
22+
- '.github/workflows/**/*.yml'
23+
- 'devops/actions/**/*.yml'
1624

1725
permissions: {}
1826

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 104 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10443,12 +10443,48 @@ static void getSPIRVBackendOpts(const llvm::opt::ArgList &TCArgs,
1044310443
TCArgs.MakeArgString("--avoid-spirv-capabilities=Shader"));
1044410444
BackendArgs.push_back(
1044510445
TCArgs.MakeArgString("--translator-compatibility-mode"));
10446-
// TODO: A list of SPIR-V extensions that are supported by the SPIR-V backend
10447-
// is growing. Let's postpone the decision on which extensions to enable until
10448-
// - the list is stable, and
10449-
// - we decide on a mapping of user requested extensions into backend's ones.
10450-
// Meanwhile we enable all the SPIR-V backend extensions.
10451-
BackendArgs.push_back(TCArgs.MakeArgString("--spirv-ext=all"));
10446+
10447+
// SPIR-V backend recently started to support extensions not supported by
10448+
// drivers (e.g. SPV_KHR_float_controls2). At the same time, SPIR-V backend
10449+
// doesn't support the syntax for disabling specific extensions (i.e.
10450+
// --spirv-ext=-<extension>). We need to come up with a list of SPIR-V
10451+
// extensions that are supported by the backend, but also by the driver. Below
10452+
// is the first approach for such a list.
10453+
// FIXME: A priori, we wouldn't expect
10454+
// SPV_EXT_relaxed_printf_string_address_space to be required, but without
10455+
// it, some SYCL E2E tests fail. Let's keep it until we figure out what's
10456+
// the problem.
10457+
std::string ExtArg("-spirv-ext=");
10458+
std::string DefaultExtArg = "+SPV_EXT_relaxed_printf_string_address_space"
10459+
",+SPV_EXT_shader_atomic_float16_add"
10460+
",+SPV_EXT_shader_atomic_float_add"
10461+
",+SPV_EXT_shader_atomic_float_min_max";
10462+
std::string IntelExtArg = ",+SPV_INTEL_2d_block_io"
10463+
",+SPV_INTEL_arbitrary_precision_integers"
10464+
",+SPV_INTEL_bfloat16_conversion"
10465+
",+SPV_INTEL_bindless_images"
10466+
",+SPV_INTEL_cache_controls"
10467+
",+SPV_INTEL_float_controls2"
10468+
",+SPV_INTEL_fp_max_error"
10469+
",+SPV_INTEL_function_pointers"
10470+
",+SPV_INTEL_inline_assembly"
10471+
",+SPV_INTEL_joint_matrix"
10472+
",+SPV_INTEL_long_composites"
10473+
",+SPV_INTEL_subgroups"
10474+
",+SPV_INTEL_tensor_float32_conversion"
10475+
",+SPV_INTEL_variable_length_array";
10476+
std::string KHRExtArg = ",+SPV_KHR_16bit_storage"
10477+
",+SPV_KHR_cooperative_matrix"
10478+
",+SPV_KHR_expect_assume"
10479+
",+SPV_KHR_float_controls"
10480+
",+SPV_KHR_linkonce_odr"
10481+
",+SPV_KHR_no_integer_wrap_decoration"
10482+
",+SPV_KHR_non_semantic_info"
10483+
",+SPV_KHR_shader_clock"
10484+
",+SPV_KHR_uniform_group_instructions";
10485+
ExtArg = ExtArg + DefaultExtArg + IntelExtArg + KHRExtArg;
10486+
BackendArgs.push_back(TCArgs.MakeArgString(ExtArg));
10487+
1045210488
// TODO:
1045310489
// - handle -Xspirv-translator option to avoid "argument unused during
1045410490
// compilation" error
@@ -11228,43 +11264,6 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1122811264
if (Args.hasArg(options::OPT_fsycl_link_EQ))
1122911265
CmdArgs.push_back(Args.MakeArgString("--sycl-device-link"));
1123011266

11231-
// -sycl-device-libraries=<comma separated list> contains all of the SYCL
11232-
// device specific libraries that are needed. This generic list will be
11233-
// populated with device binaries for all target triples in the current
11234-
// compilation flow.
11235-
11236-
// Create a comma separated list to pass along to the linker wrapper.
11237-
SmallString<256> LibList;
11238-
llvm::Triple TargetTriple;
11239-
auto ToolChainRange = C.getOffloadToolChains<Action::OFK_SYCL>();
11240-
for (auto &I :
11241-
llvm::make_range(ToolChainRange.first, ToolChainRange.second)) {
11242-
const ToolChain *TC = I.second;
11243-
// Note: For AMD targets, we do not pass any SYCL device libraries.
11244-
if (TC->getTriple().isSPIROrSPIRV() || TC->getTriple().isNVPTX()) {
11245-
TargetTriple = TC->getTriple();
11246-
SmallVector<std::string, 8> SYCLDeviceLibs;
11247-
bool IsSPIR = TargetTriple.isSPIROrSPIRV();
11248-
bool IsSpirvAOT = TargetTriple.isSPIRAOT();
11249-
bool UseJitLink =
11250-
IsSPIR &&
11251-
Args.hasFlag(options::OPT_fsycl_device_lib_jit_link,
11252-
options::OPT_fno_sycl_device_lib_jit_link, false);
11253-
bool UseAOTLink = IsSPIR && (IsSpirvAOT || !UseJitLink);
11254-
SYCLDeviceLibs = SYCL::getDeviceLibraries(C, TargetTriple, UseAOTLink);
11255-
for (const auto &AddLib : SYCLDeviceLibs) {
11256-
if (LibList.size() > 0)
11257-
LibList += ",";
11258-
LibList += AddLib;
11259-
}
11260-
}
11261-
}
11262-
// -sycl-device-libraries=<libs> provides a comma separate list of
11263-
// libraries to add to the device linking step.
11264-
if (LibList.size())
11265-
CmdArgs.push_back(
11266-
Args.MakeArgString(Twine("-sycl-device-libraries=") + LibList));
11267-
1126811267
// -sycl-device-library-location=<dir> provides the location in which the
1126911268
// SYCL device libraries can be found.
1127011269
SmallString<128> DeviceLibDir(D.Dir);
@@ -11289,6 +11288,68 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1128911288
break;
1129011289
}
1129111290
}
11291+
11292+
// -sycl-device-libraries=<comma separated list> contains a list of
11293+
// file names for fat object files that contain SYCL device library bitcode
11294+
// necessary for SYCL offloading that will be linked to the user's device
11295+
// code. clang-linker-wrapper uses the value provided to
11296+
// -sycl-device-library-location=<dir> to construct the full paths of the
11297+
// device libraries.
11298+
11299+
// On the other hand, --bitcode-library=<triple>=<path to bc file> specifies
11300+
// one bitcode library to link in for a specific triple. Additionally, the
11301+
// path is *not* relative to the -sycl-device-library-location - the full
11302+
// path must be provided.
11303+
SmallString<256> LibList;
11304+
SmallVector<std::string, 4> BCLibList;
11305+
11306+
auto appendToList = [](SmallString<256> &List, const Twine &Arg) {
11307+
if (List.size() > 0)
11308+
List += ",";
11309+
List += Arg.str();
11310+
};
11311+
11312+
auto ToolChainRange = C.getOffloadToolChains<Action::OFK_SYCL>();
11313+
for (const auto &[Kind, TC] :
11314+
llvm::make_range(ToolChainRange.first, ToolChainRange.second)) {
11315+
llvm::Triple TargetTriple = TC->getTriple();
11316+
bool IsSPIR = TargetTriple.isSPIROrSPIRV();
11317+
bool IsSpirAOT = TargetTriple.isSPIRAOT();
11318+
bool UseJitLink =
11319+
IsSPIR &&
11320+
Args.hasFlag(options::OPT_fsycl_device_lib_jit_link,
11321+
options::OPT_fno_sycl_device_lib_jit_link, false);
11322+
bool UseAOTLink = IsSPIR && (IsSpirAOT || !UseJitLink);
11323+
SmallVector<std::string, 8> SYCLDeviceLibs =
11324+
SYCL::getDeviceLibraries(C, TargetTriple, UseAOTLink);
11325+
for (const auto &AddLib : SYCLDeviceLibs) {
11326+
if (llvm::sys::path::extension(AddLib) == ".bc") {
11327+
SmallString<256> LibPath(DeviceLibDir);
11328+
llvm::sys::path::append(LibPath, AddLib);
11329+
BCLibList.push_back(
11330+
(Twine(TC->getTriple().str()) + "=" + LibPath).str());
11331+
continue;
11332+
}
11333+
11334+
appendToList(LibList, AddLib);
11335+
}
11336+
11337+
if (TC->getTriple().isNVPTX())
11338+
if (const char *LibSpirvFile = SYCLInstallation.findLibspirvPath(
11339+
TC->getTriple(), Args, *TC->getAuxTriple()))
11340+
BCLibList.push_back(
11341+
(Twine(TC->getTriple().str()) + "=" + LibSpirvFile).str());
11342+
}
11343+
11344+
if (LibList.size())
11345+
CmdArgs.push_back(
11346+
Args.MakeArgString(Twine("-sycl-device-libraries=") + LibList));
11347+
11348+
if (BCLibList.size())
11349+
for (const std::string &Lib : BCLibList)
11350+
CmdArgs.push_back(
11351+
Args.MakeArgString(Twine("--bitcode-library=") + Lib));
11352+
1129211353
CmdArgs.push_back(Args.MakeArgString(
1129311354
Twine("-sycl-device-library-location=") + DeviceLibDir));
1129411355

clang/lib/Serialization/ASTReaderStmt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,22 +1866,26 @@ void ASTStmtReader::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
18661866
}
18671867

18681868
void ASTStmtReader::VisitSYCLBuiltinNumFieldsExpr(SYCLBuiltinNumFieldsExpr *E) {
1869+
VisitExpr(E);
18691870
E->setLocation(readSourceLocation());
18701871
E->SourceTy = Record.readType();
18711872
}
18721873

18731874
void ASTStmtReader::VisitSYCLBuiltinFieldTypeExpr(SYCLBuiltinFieldTypeExpr *E) {
1875+
VisitExpr(E);
18741876
E->setLocation(readSourceLocation());
18751877
E->SourceTy = Record.readType();
18761878
E->Index = Record.readExpr();
18771879
}
18781880

18791881
void ASTStmtReader::VisitSYCLBuiltinNumBasesExpr(SYCLBuiltinNumBasesExpr *E) {
1882+
VisitExpr(E);
18801883
E->setLocation(readSourceLocation());
18811884
E->SourceTy = Record.readType();
18821885
}
18831886

18841887
void ASTStmtReader::VisitSYCLBuiltinBaseTypeExpr(SYCLBuiltinBaseTypeExpr *E) {
1888+
VisitExpr(E);
18851889
E->setLocation(readSourceLocation());
18861890
E->SourceTy = Record.readType();
18871891
E->Index = Record.readExpr();

clang/lib/Serialization/ASTWriterStmt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,25 +1869,29 @@ void ASTStmtWriter::VisitBuiltinBitCastExpr(BuiltinBitCastExpr *E) {
18691869
}
18701870

18711871
void ASTStmtWriter::VisitSYCLBuiltinNumFieldsExpr(SYCLBuiltinNumFieldsExpr *E) {
1872+
VisitExpr(E);
18721873
Record.AddSourceLocation(E->getLocation());
18731874
Record.AddTypeRef(E->getSourceType());
18741875
Code = serialization::EXPR_SYCL_BUILTIN_NUM_FIELDS;
18751876
}
18761877

18771878
void ASTStmtWriter::VisitSYCLBuiltinFieldTypeExpr(SYCLBuiltinFieldTypeExpr *E) {
1879+
VisitExpr(E);
18781880
Record.AddSourceLocation(E->getLocation());
18791881
Record.AddTypeRef(E->getSourceType());
18801882
Record.AddStmt(E->getIndex());
18811883
Code = serialization::EXPR_SYCL_BUILTIN_FIELD_TYPE;
18821884
}
18831885

18841886
void ASTStmtWriter::VisitSYCLBuiltinNumBasesExpr(SYCLBuiltinNumBasesExpr *E) {
1887+
VisitExpr(E);
18851888
Record.AddSourceLocation(E->getLocation());
18861889
Record.AddTypeRef(E->getSourceType());
18871890
Code = serialization::EXPR_SYCL_BUILTIN_NUM_BASES;
18881891
}
18891892

18901893
void ASTStmtWriter::VisitSYCLBuiltinBaseTypeExpr(SYCLBuiltinBaseTypeExpr *E) {
1894+
VisitExpr(E);
18911895
Record.AddSourceLocation(E->getLocation());
18921896
Record.AddTypeRef(E->getSourceType());
18931897
Record.AddStmt(E->getIndex());

0 commit comments

Comments
 (0)