Skip to content

Commit c5f07b6

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (14 commits)
2 parents b547469 + 1af67b1 commit c5f07b6

File tree

30 files changed

+924
-352
lines changed

30 files changed

+924
-352
lines changed

.github/workflows/libcxx-check-generated-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616

1717
- name: Install dependencies
18-
uses: aminya/setup-cpp@004edc19527a83d56cda032658aab55c5e2ed48f # v1.7.0
18+
uses: aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
1919
with:
2020
clangformat: 17.0.1
2121
ninja: true

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
echo "$CHANGED_FILES"
5656
5757
- name: Install clang-format
58-
uses: aminya/setup-cpp@004edc19527a83d56cda032658aab55c5e2ed48f # v1.7.0
58+
uses: aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
5959
with:
6060
clangformat: 20.1.8
6161

.github/workflows/release-lit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} --user-token "$USER_TOKEN" check-permissions
4646
4747
- name: Setup Cpp
48-
uses: aminya/setup-cpp@004edc19527a83d56cda032658aab55c5e2ed48f # v1.7.0
48+
uses: aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
4949
with:
5050
compiler: llvm-16.0.6
5151
cmake: true

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ on:
179179
- e2e
180180
- cts
181181
- benchmarks
182+
toolchain_release_tag:
183+
description: |
184+
Tag of a "Nightly" release at https://github.com/intel/llvm/releases.
185+
default: ''
182186

183187
env:
184188
description: |
@@ -256,11 +260,6 @@ jobs:
256260
uses: actions/download-artifact@v4
257261
with:
258262
name: ${{ inputs.toolchain_artifact }}
259-
- name: Debug prints [workflow_run]
260-
if: inputs.toolchain_artifact != '' && github.event_name == 'workflow_run'
261-
run: |
262-
pwd
263-
ls
264263
- name: Download SYCL toolchain [workflow_run]
265264
# NOTE: This is for `sycl-linux-precommit-aws.yml`.
266265
if: inputs.toolchain_artifact != '' && github.event_name == 'workflow_run'
@@ -299,6 +298,17 @@ jobs:
299298
rm -f ${{ inputs.toolchain_artifact_filename }}
300299
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
301300
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
301+
- name: Download SYCL toolchain using release tag
302+
if: inputs.toolchain_release_tag != ''
303+
env:
304+
TAG: ${{ inputs.toolchain_release_tag }}
305+
shell: bash
306+
run: |
307+
mkdir toolchain
308+
wget "https://github.com/intel/llvm/releases/download/$TAG/sycl_linux.tar.gz"
309+
tar xf sycl_linux.tar.gz -C toolchain
310+
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
311+
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
302312
- run: which clang++ sycl-ls
303313
- run: sycl-ls --verbose
304314
- run: SYCL_UR_TRACE=1 sycl-ls

.github/workflows/sycl-nightly-benchmarking.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: SYCL Nightly Benchmarking
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 2 * * *'
6+
- cron: '0 0 * * *'
7+
# 3 hours ahead of SYCL nightly
78

89
permissions: read-all
910

@@ -31,7 +32,7 @@ jobs:
3132
include:
3233
- ref: ${{ github.sha }}
3334
save_name: 'Baseline'
34-
preset: 'Minimal'
35+
preset: 'Full'
3536
uses: ./.github/workflows/sycl-linux-run-tests.yml
3637
secrets: inherit
3738
with:

buildbot/configure.py

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ def do_configure(args, passthrough_args):
137137
# CI Default conditionally appends to options, keep it at the bottom of
138138
# args handling
139139
if args.ci_defaults:
140-
print("#############################################")
141-
print("# Default CI configuration will be applied. #")
142-
print("#############################################")
140+
if not args.print_cmake_flags:
141+
print("#############################################")
142+
print("# Default CI configuration will be applied. #")
143+
print("#############################################")
143144

144145
# For clang-format, clang-tidy and code coverage
145146
llvm_enable_projects += ";clang-tools-extra;compiler-rt"
@@ -255,20 +256,24 @@ def do_configure(args, passthrough_args):
255256
)
256257

257258
cmake_cmd += passthrough_args
258-
print("[Cmake Command]: {}".format(" ".join(map(shlex.quote, cmake_cmd))))
259-
260-
try:
261-
subprocess.check_call(cmake_cmd, cwd=abs_obj_dir)
262-
except subprocess.CalledProcessError:
263-
cmake_cache = os.path.join(abs_obj_dir, "CMakeCache.txt")
264-
if os.path.isfile(cmake_cache):
265-
print(
266-
"There is CMakeCache.txt at "
267-
+ cmake_cache
268-
+ " ... you can try to remove it and rerun."
269-
)
270-
print("Configure failed!")
271-
return False
259+
260+
if args.print_cmake_flags:
261+
print(" ".join(map(shlex.quote, cmake_cmd[1:])))
262+
else:
263+
print("[Cmake Command]: {}".format(" ".join(map(shlex.quote, cmake_cmd))))
264+
265+
try:
266+
subprocess.check_call(cmake_cmd, cwd=abs_obj_dir)
267+
except subprocess.CalledProcessError:
268+
cmake_cache = os.path.join(abs_obj_dir, "CMakeCache.txt")
269+
if os.path.isfile(cmake_cache):
270+
print(
271+
"There is CMakeCache.txt at "
272+
+ cmake_cache
273+
+ " ... you can try to remove it and rerun."
274+
)
275+
print("Configure failed!")
276+
return False
272277

273278
return True
274279

@@ -411,9 +416,15 @@ def main():
411416
parser.add_argument(
412417
"--use-zstd", action="store_true", help="Force zstd linkage while building."
413418
)
419+
parser.add_argument(
420+
"--print-cmake-flags",
421+
action="store_true",
422+
help="Print the generated CMake flags to a single line on standard output and exit. Suppresses all other output and does not run the cmake command.",
423+
)
414424
args, passthrough_args = parser.parse_known_intermixed_args()
415425

416-
print("args:{}".format(args))
426+
if not args.print_cmake_flags:
427+
print("args:{}".format(args))
417428

418429
return do_configure(args, passthrough_args)
419430

clang/lib/Basic/Targets/NativeCPU.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ NativeCPUTargetInfo::NativeCPUTargetInfo(const llvm::Triple &Triple,
4848
UseAddrSpaceMapMangling = true;
4949
HasLegalHalfType = true;
5050
HasFloat16 = true;
51-
resetDataLayout("e");
5251

5352
llvm::Triple HostTriple([&] {
5453
// Take the default target triple if no other host triple is specified so
@@ -58,14 +57,19 @@ NativeCPUTargetInfo::NativeCPUTargetInfo(const llvm::Triple &Triple,
5857

5958
return llvm::Triple(Opts.HostTriple);
6059
}());
61-
if (!HostTriple.isNativeCPU()) {
60+
if (HostTriple.isNativeCPU()) {
61+
// This should never happen, just make sure we do not crash.
62+
resetDataLayout("e");
63+
} else {
6264
HostTarget = AllocateTarget(HostTriple, Opts);
6365
copyAuxTarget(&*HostTarget);
66+
resetDataLayout(HostTarget->getDataLayoutString());
6467
}
6568
}
6669

6770
void NativeCPUTargetInfo::setAuxTarget(const TargetInfo *Aux) {
6871
assert(Aux && "Cannot invoke setAuxTarget without a valid auxiliary target!");
6972
copyAuxTarget(Aux);
7073
getTargetOpts() = Aux->getTargetOpts();
74+
resetDataLayout(Aux->getDataLayoutString());
7175
}

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6979,6 +6979,10 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
69796979

69806980
for (const KernelDesc &K : KernelDescs) {
69816981
const size_t N = K.Params.size();
6982+
if (S.isFreeFunction(K.SyclKernel)) {
6983+
CurStart += N;
6984+
continue;
6985+
}
69826986
PresumedLoc PLoc = S.getASTContext().getSourceManager().getPresumedLoc(
69836987
S.getASTContext()
69846988
.getSourceManager()

clang/test/CodeGenSYCL/free_function_int_header_rtc_mode.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ int main(){
4444
// CHECK-NEXT: "{{.*}}__sycl_kernel_free_function_nd_rangePiii",
4545
// CHECK-NEXT: "{{.*}}Kernel_Function",
4646

47-
48-
// CHECK: static constexpr const char* getName() { return "{{.*}}__sycl_kernel_free_function_singlePiii"; }
49-
// CHECK: static constexpr const char* getName() { return "{{.*}}__sycl_kernel_free_function_nd_rangePiii"; }
50-
// CHECK: static constexpr const char* getName() { return "{{.*}}Kernel_Function"; }
47+
// CHECK: _Z34__sycl_kernel_free_function_singlePiii
48+
// CHECK: _Z36__sycl_kernel_free_function_nd_rangePiii
49+
// CHECK: _ZTSZ4mainE15Kernel_Function
5150

5251
// CHECK-RTC-NOT: free_function_single_kernel
5352
// CHECK-RTC-NOT: free_function_nd_range

clang/test/CodeGenSYCL/native_cpu_target_features.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// RUN: %clang_cc1 -triple native_cpu -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,NOAVX
2-
// RUN: %clang_cc1 -triple native_cpu -aux-triple x86_64-unknown-linux-gnu -aux-target-cpu skylake -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,AVX
3-
// RUN: %clang_cc1 -triple native_cpu -aux-triple x86_64-unknown-linux-gnu -aux-target-feature +avx -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,AVX
1+
// RUN: %clang_cc1 -triple native_cpu -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,X86,NOAVX
2+
// RUN: %clang_cc1 -triple native_cpu -aux-triple x86_64-unknown-linux-gnu -aux-target-cpu skylake -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,X86,AVX
3+
// RUN: %clang_cc1 -triple native_cpu -aux-triple x86_64-unknown-linux-gnu -aux-target-feature +avx -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,X86,AVX
44
//
55
// This is not sensible but check that we do not crash.
6-
// RUN: %clang_cc1 -triple native_cpu -aux-triple native_cpu -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,NOAVX
6+
// RUN: %clang_cc1 -triple native_cpu -aux-triple native_cpu -fsycl-is-device -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,NOX86,NOAVX
77

88
#include "Inputs/sycl.hpp"
99
using namespace sycl;
@@ -14,6 +14,9 @@ int main() {
1414
deviceQueue.submit([&](handler &h) { h.single_task<Test>([=] {}); });
1515
}
1616

17+
// X86: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
18+
// NOX86: target datalayout = "e"
19+
1720
// CHECK: void @_ZTS4Test() [[ATTRS:#[0-9]+]]
1821
// CHECK: [[ATTRS]] = {
1922
// NOAVX-NOT: "target-features"="{{[^"]*}}+avx{{[^"]*}}"

0 commit comments

Comments
 (0)