Skip to content

Commit 3310dad

Browse files
committed
Merge remote-tracking branch 'intel/sycl' into Alcpz/impl-SYCLcompat
2 parents 2376acc + 4b44182 commit 3310dad

File tree

15 files changed

+175
-155
lines changed

15 files changed

+175
-155
lines changed

.github/workflows/sycl_exp_precommit.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/sycl_nightly.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ jobs:
3131
# prefer widespread gzip compression.
3232
artifact_archive_name: sycl_linux.tar.gz
3333

34-
ubuntu2204_opaque_pointers_build_test:
35-
if: github.repository == 'intel/llvm'
36-
uses: ./.github/workflows/sycl_linux_build_and_test.yml
37-
needs: test_matrix
38-
secrets: inherit
39-
with:
40-
build_cache_root: "/__w/"
41-
build_cache_suffix: opaque_pointers
42-
build_artifact_suffix: opaque_pointers
43-
build_configure_extra_args: "--hip --cuda --enable-esimd-emulator --cmake-opt=-DSPIRV_ENABLE_OPAQUE_POINTERS=TRUE"
44-
merge_ref: ''
45-
4634
windows_default:
4735
name: Windows
4836
if: github.repository == 'intel/llvm'

.github/workflows/sycl_precommit_aws.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: E2E on AWS CUDA
2+
run-name: E2E on AWS CUDA - ${{ github.event.workflow_run.display_title }}
3+
# We have to keep pre-commit AWS CUDA testing in a separate workflow because we
4+
# need access to AWS secret and that isn't available on pull_request jobs for
5+
# PRs from forks. And github's "require approval for all outside collaborators"
6+
# is bypassed on pull_request_target.
7+
#
8+
# Also, we use commit status and not check suite/run (which, in theory, is more
9+
# powerful) due to https://github.com/orgs/community/discussions/24616.
210

311
on:
412
workflow_run:
5-
workflows: [SYCL Experimental Pre-Commit]
13+
workflows: [SYCL Pre Commit on Linux]
614
types:
715
- completed
816

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: SYCL Pre Commit on Linux
22

33
on:
4-
pull_request_target:
4+
# We rely on "Fork pull request workflows from outside collaborators" -
5+
# "Require approval for all outside collaborators" at
6+
# https://github.com/intel/llvm/settings/actions for security.
7+
pull_request:
58
branches:
69
- sycl
710
- sycl-devops-pr/**
8-
- llvmspirv_pulldown
911
# Do not run builds if changes are only in the following locations
1012
paths-ignore:
1113
- '.github/ISSUE_TEMPLATE/**'
@@ -15,32 +17,19 @@ on:
1517
- 'clang/docs/**'
1618
- '**.md'
1719
- '**.rst'
18-
# Changes in CI won't have any effect with pull_request_target
19-
- '.github/workflows'
20-
# For CI-related files we explicitly skip all the jobs below even if there
21-
# were other (non-ignored) files modified in this PR.
22-
- 'devops/*/**'
23-
24-
permissions:
25-
contents: read
2620

2721
jobs:
2822
detect_changes:
2923
uses: ./.github/workflows/sycl_detect_changes.yml
3024

3125
lint:
32-
needs: [detect_changes]
33-
if: |
34-
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
35-
!contains(needs.detect_changes.outputs.filters, 'ci')
3626
runs-on: [Linux, build]
3727
container:
3828
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:no-drivers
3929
options: -u 1001:1001
4030
steps:
4131
- uses: actions/checkout@v3
4232
with:
43-
ref: ${{ github.base_ref }}
4433
sparse-checkout: |
4534
devops/actions/cached_checkout
4635
devops/actions/clang-format
@@ -61,36 +50,55 @@ jobs:
6150
with:
6251
path: src
6352

64-
# This job generates matrix of tests for SYCL End-to-End tests
65-
test_matrix:
66-
needs: [detect_changes]
67-
if: |
68-
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
69-
!contains(needs.detect_changes.outputs.filters, 'ci')
70-
name: Generate Test Matrix
71-
uses: ./.github/workflows/sycl_gen_test_matrix.yml
72-
with:
73-
ref: ${{ github.event.pull_request.head.sha }}
74-
lts_config: "hip_amdgpu;lin_intel;esimd_emu;cuda_aws"
75-
76-
linux_default:
77-
name: Linux
78-
# Only build and test patches, that have passed all linter checks, because
79-
# the next commit is likely to be a follow-up on that job.
80-
needs: [lint, test_matrix, detect_changes]
53+
build:
54+
needs: [lint, detect_changes]
8155
if: |
8256
always()
8357
&& (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
84-
&& (github.event.pull_request.head.repo.full_name == 'intel/llvm'
85-
|| !contains(needs.detect_changes.outputs.filters, 'ci'))
86-
uses: ./.github/workflows/sycl_linux_build_and_test.yml
87-
secrets: inherit
58+
uses: ./.github/workflows/sycl_linux_build.yml
8859
with:
89-
build_ref: ${{ github.event.pull_request.head.sha }}
90-
merge_ref: ${{ github.event.pull_request.base.sha }}
60+
build_ref: ${{ github.sha }}
61+
merge_ref: ''
9162
build_cache_root: "/__w/"
9263
build_artifact_suffix: "default"
9364
build_cache_suffix: "default"
94-
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
95-
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
9665
changes: ${{ needs.detect_changes.outputs.filters }}
66+
67+
test:
68+
needs: [build, detect_changes]
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
include:
73+
- name: ESIMD Emu
74+
runner: '["Linux", "x86-cpu"]'
75+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
76+
image_options: -u 1001
77+
target_devices: ext_intel_esimd_emulator:gpu
78+
- name: AMD/HIP
79+
runner: '["Linux", "amdgpu"]'
80+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
81+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
82+
target_devices: ext_oneapi_hip:gpu
83+
- name: Intel
84+
runner: '["Linux", "gen12"]'
85+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
86+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
87+
target_devices: ext_oneapi_level_zero:gpu;opencl:gpu;opencl:cpu
88+
reset_gpu: ${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}
89+
uses: ./.github/workflows/sycl_linux_run_tests.yml
90+
with:
91+
name: ${{ matrix.name }}
92+
runner: ${{ matrix. runner }}
93+
image: ${{ matrix.image }}
94+
image_options: ${{ matrix.image_options }}
95+
target_devices: ${{ matrix.target_devices }}
96+
reset_gpu: ${{ matrix.reset_gpu }}
97+
98+
ref: ${{ github.sha }}
99+
merge_ref: ''
100+
101+
sycl_toolchain_artifact: sycl_linux_default
102+
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
103+
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
104+

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,6 +4031,7 @@ def VecTypeHint : InheritableAttr {
40314031
let Spellings = [GNU<"vec_type_hint">, CXX11<"sycl", "vec_type_hint">];
40324032
let Args = [TypeArgument<"TypeHint">];
40334033
let Subjects = SubjectList<[Function], ErrorDiag>;
4034+
let SupportsNonconformingLambdaSyntax = 1;
40344035
let Documentation = [Undocumented];
40354036
}
40364037

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11979,6 +11979,9 @@ def warn_ivdep_attribute_argument : Warning<
1197911979
def warn_attribute_spelling_deprecated : Warning<
1198011980
"attribute %0 is deprecated">,
1198111981
InGroup<DeprecatedAttributes>;
11982+
def warn_attribute_deprecated_ignored : Warning<
11983+
"attribute %0 is deprecated; attribute ignored">,
11984+
InGroup<DeprecatedAttributes>;
1198211985
def note_spelling_suggestion : Note<
1198311986
"did you mean to use %0 instead?">;
1198411987
def warn_attribute_requires_non_negative_integer_argument :

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4550,8 +4550,11 @@ static void handleSYCLIntelLoopFuseAttr(Sema &S, Decl *D, const ParsedAttr &A) {
45504550

45514551
static void handleVecTypeHint(Sema &S, Decl *D, const ParsedAttr &AL) {
45524552
// This attribute is deprecated without replacement in SYCL 2020 mode.
4553-
if (S.LangOpts.getSYCLVersion() > LangOptions::SYCL_2017)
4554-
S.Diag(AL.getLoc(), diag::warn_attribute_spelling_deprecated) << AL;
4553+
// Ignore the attribute in SYCL 2020.
4554+
if (S.LangOpts.getSYCLVersion() > LangOptions::SYCL_2017) {
4555+
S.Diag(AL.getLoc(), diag::warn_attribute_deprecated_ignored) << AL;
4556+
return;
4557+
}
45554558

45564559
// If the attribute is used with the [[sycl::vec_type_hint]] spelling in SYCL
45574560
// 2017 mode, we want to warn about using the newer name in the older
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %clang_cc1 -fsycl-is-device -sycl-std=2020 -internal-isystem %S/Inputs -fsyntax-only -verify %s
2+
3+
// Test which verifies [[sycl::vec_type_hint()]] is accepted
4+
// with non-conforming lambda syntax.
5+
6+
// NOTE: This attribute is not supported in the SYCL backends.
7+
// To be minimally conformant with SYCL2020, attribute is
8+
// accepted by the Clang FE with a warning. No additional
9+
// semantic handling or IR generation is done for this
10+
// attribute.
11+
12+
#include "sycl.hpp"
13+
14+
struct test {};
15+
16+
using namespace sycl;
17+
queue q;
18+
19+
void bar() {
20+
q.submit([&](handler &h) {
21+
h.single_task<class kernelname>(
22+
// expected-warning@+1 {{attribute 'vec_type_hint' is deprecated; attribute ignored}}
23+
[]() [[sycl::vec_type_hint(test)]] {});
24+
});
25+
}
26+

clang/test/SemaSYCL/vec-type-hint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
// __attribute__((vec_type_hint)) is deprecated without replacement in SYCL
99
// 2020 mode, but is allowed in SYCL 2017 and OpenCL modes.
10-
KERNEL __attribute__((vec_type_hint(int))) void foo() {} // sycl-2020-warning {{attribute 'vec_type_hint' is deprecated}}
10+
KERNEL __attribute__((vec_type_hint(int))) void foo() {} // sycl-2020-warning {{attribute 'vec_type_hint' is deprecated; attribute ignored}}

llvm/lib/SYCLLowerIR/ESIMD/ESIMDVerifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static const char *LegalSYCLFunctions[] = {
6363
"^sycl::_V1::ext::oneapi::sub_group::.+",
6464
"^sycl::_V1::ext::oneapi::experimental::spec_constant<.+>::.+",
6565
"^sycl::_V1::ext::oneapi::experimental::this_sub_group",
66+
"^sycl::_V1::ext::oneapi::experimental::uniform<.+>::.+",
6667
"^sycl::_V1::ext::oneapi::bfloat16::.+",
6768
"^sycl::_V1::ext::oneapi::experimental::if_architecture_is"};
6869

sycl/include/sycl/builtins.hpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ std::enable_if_t<__FAST_MATH_GENFLOAT(T), T> sin(T x) __NOEXC {
734734

735735
// svgenfloat sincos (svgenfloat x, genfloatptr cosval)
736736
template <typename T, typename T2>
737-
std::enable_if_t<
738-
detail::is_svgenfloat<T>::value && detail::is_genfloatptr<T2>::value, T>
737+
std::enable_if_t<__FAST_MATH_GENFLOAT(T) && detail::is_genfloatptr<T2>::value,
738+
T>
739739
sincos(T x, T2 cosval) __NOEXC {
740740
detail::check_vector_size<T, T2>();
741741
return __sycl_std::__invoke_sincos<T>(x, cosval);
@@ -2500,6 +2500,23 @@ std::enable_if_t<detail::is_svgenfloatf<T>::value, T> cos(T x) __NOEXC {
25002500
return native::cos(x);
25012501
}
25022502

2503+
// svgenfloat sincos (svgenfloat x, genfloatptr cosval)
2504+
// This is a performance optimization to ensure that sincos isn't slower than a
2505+
// pair of sin/cos executed separately. Theoretically, calling non-native sincos
2506+
// might be faster than calling native::sin plus native::cos separately and we'd
2507+
// need some kind of cost model to make the right decision (and move this
2508+
// entirely to the JIT/AOT compilers). However, in practice, this simpler
2509+
// solution seems to work just fine and matches how sin/cos above are optimized
2510+
// for the fast math path.
2511+
template <typename T, typename T2>
2512+
std::enable_if_t<
2513+
detail::is_svgenfloatf<T>::value && detail::is_genfloatptr<T2>::value, T>
2514+
sincos(T x, T2 cosval) __NOEXC {
2515+
detail::check_vector_size<T, T2>();
2516+
*cosval = native::cos(x);
2517+
return native::sin(x);
2518+
}
2519+
25032520
// svgenfloatf exp (svgenfloatf x)
25042521
template <typename T>
25052522
std::enable_if_t<detail::is_svgenfloatf<T>::value, T> exp(T x) __NOEXC {

sycl/include/sycl/ext/oneapi/experimental/invoke_simd.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ constexpr bool has_struct_arg(Ret (*)(Args...)) {
371371

372372
template <typename Ret, typename... Args>
373373
constexpr bool has_struct_ret(Ret (*)(Args...)) {
374-
return std::is_class_v<Ret> && !is_simd_or_mask_type<Ret>::value;
374+
return std::is_class_v<Ret> && !is_simd_or_mask_type<Ret>::value &&
375+
!is_uniform_type<Ret>::value;
375376
}
376377

377378
template <typename Ret, typename... Args>

0 commit comments

Comments
 (0)