Skip to content

Commit 79672ed

Browse files
committed
Merge branch 'sycl' into amd-markup-change
2 parents 6bc2de6 + 254dd3b commit 79672ed

31 files changed

+339
-182
lines changed

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

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,8 @@ jobs:
5151
changes: ${{ needs.detect_changes.outputs.filters }}
5252
e2e_binaries_artifact: sycl_e2e_bin_default
5353

54-
determine_arc_tests:
55-
name: Decide which Arc tests to run
56-
needs: [build, detect_changes]
57-
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
58-
runs-on: [Linux, aux-tasks]
59-
timeout-minutes: 3
60-
outputs:
61-
arc_tests: ${{ steps.arc_tests.outputs.arc_tests }}
62-
steps:
63-
- name: Determine Arc tests
64-
id: arc_tests
65-
run: |
66-
if [ "${{ contains(needs.detect_changes.outputs.filters, 'devigccfg') }}" == "true" ]; then
67-
echo 'arc_tests="(ESIMD|InvokeSimd|Matrix)/"' >> "$GITHUB_OUTPUT"
68-
elif [ "${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}" == "true" ]; then
69-
echo 'arc_tests=""' >> "$GITHUB_OUTPUT"
70-
elif [ "${{ contains(needs.detect_changes.outputs.filters, 'esimd') }}" == "true" ]; then
71-
echo 'arc_tests="(ESIMD|InvokeSimd|Matrix)/"' >> "$GITHUB_OUTPUT"
72-
else
73-
echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT"
74-
fi
75-
7654
run_prebuilt_e2e_tests:
77-
needs: [build, detect_changes, determine_arc_tests]
55+
needs: [build, detect_changes]
7856
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
7957
strategy:
8058
fail-fast: false
@@ -96,7 +74,19 @@ jobs:
9674
target_devices: level_zero:gpu;opencl:gpu
9775
reset_intel_gpu: true
9876
extra_lit_opts: --param matrix-xmx8=True
99-
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
77+
- name: E2E tests with dev igc on Intel Arc A-Series Graphics
78+
runner: '["Linux", "arc"]'
79+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
80+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
81+
target_devices: level_zero:gpu;opencl:gpu
82+
reset_intel_gpu: true
83+
extra_lit_opts: --param matrix-xmx8=True
84+
use_igc_dev: true
85+
- name: E2E tests on Intel Ponte Vecchio GPU
86+
runner: '["Linux", "pvc"]'
87+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
88+
target_devices: level_zero:gpu;opencl:gpu
89+
extra_lit_opts: -j 50
10090
- name: Dev IGC on Intel Ponte Vecchio GPU
10191
runner: '["Linux", "pvc"]'
10292
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
@@ -141,7 +131,7 @@ jobs:
141131
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
142132

143133
test:
144-
needs: [build, detect_changes, determine_arc_tests]
134+
needs: [build, detect_changes]
145135
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
146136
strategy:
147137
fail-fast: false
@@ -151,46 +141,13 @@ jobs:
151141
runner: '["Linux", "amdgpu"]'
152142
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
153143
target_devices: hip:gpu
154-
reset_intel_gpu: false
155-
- name: E2E tests with dev igc on Intel Arc A-Series Graphics
156-
runner: '["Linux", "arc"]'
157-
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
158-
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
159-
target_devices: level_zero:gpu;opencl:gpu
160-
reset_intel_gpu: true
161-
extra_lit_opts: --param matrix-xmx8=True
162-
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
163-
use_igc_dev: true
164-
- name: E2E tests on Intel Ponte Vecchio GPU
165-
runner: '["Linux", "pvc"]'
166-
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
167-
target_devices: level_zero:gpu;opencl:gpu
168-
extra_lit_opts: -j 50
169144

170145
uses: ./.github/workflows/sycl-linux-run-tests.yml
171146
with:
172147
name: ${{ matrix.name }}
173148
runner: ${{ matrix. runner }}
174-
image: ${{ matrix.image }}
175149
image_options: ${{ matrix.image_options }}
176150
target_devices: ${{ matrix.target_devices }}
177-
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
178-
extra_lit_opts: ${{ matrix.extra_lit_opts }}
179-
env: ${{ matrix.env || '{}' }}
180-
181-
# Do not install drivers on AMD and CUDA runners.
182-
install_igc_driver: >-
183-
${{ !contains(matrix.target_devices, 'cuda') &&
184-
!contains(matrix.target_devices, 'hip') &&
185-
contains(needs.detect_changes.outputs.filters, 'drivers') }}
186-
install_dev_igc_driver: >-
187-
${{ !contains(matrix.target_devices, 'cuda') &&
188-
!contains(matrix.target_devices, 'hip') &&
189-
matrix.use_igc_dev &&
190-
(contains(needs.detect_changes.outputs.filters, 'devigccfg') || contains(needs.detect_changes.outputs.filters, 'drivers')) ||
191-
'false' }}
192-
# Run only if the PR does not have the 'ci-no-devigc' label.
193-
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
194151

195152
ref: ${{ github.sha }}
196153

.github/workflows/sycl-nightly.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,46 +60,61 @@ jobs:
6060
runner: '["Linux", "amdgpu"]'
6161
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
6262
target_devices: hip:gpu
63-
tests_selector: e2e
6463

65-
- name: Intel L0 GPU
64+
- name: NVIDIA/CUDA
65+
runner: '["Linux", "cuda"]'
66+
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
67+
target_devices: cuda:gpu
68+
69+
- name: Intel L0 Gen12 GPU
6670
runner: '["Linux", "gen12"]'
6771
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
6872
target_devices: level_zero:gpu
6973
reset_intel_gpu: true
70-
tests_selector: e2e
7174

72-
- name: Intel OCL GPU
75+
- name: Intel L0 Ponte Vecchio GPU
76+
runner: '["Linux", "pvc"]'
77+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
78+
target_devices: level_zero:gpu
79+
80+
- name: Intel L0 Battlemage GPU
81+
runner: '["Linux", "bmg"]'
82+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
83+
target_devices: level_zero:gpu
84+
85+
- name: Intel L0 Arc A-Series GPU
86+
runner: '["Linux", "arc"]'
87+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
88+
target_devices: level_zero:gpu
89+
reset_intel_gpu: true
90+
91+
- name: Intel OCL Gen12 GPU
7392
runner: '["Linux", "gen12"]'
7493
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
7594
target_devices: opencl:gpu
7695
reset_intel_gpu: true
77-
tests_selector: e2e
7896

7997
- name: OCL CPU (AMD)
8098
runner: '["Linux", "amdcpu"]'
8199
image_options: -u 1001
82100
target_devices: opencl:cpu
83-
tests_selector: e2e
84101

85102
- name: OCL CPU (Intel/GEN12)
86103
runner: '["Linux", "gen12"]'
87104
image_options: -u 1001 --privileged --cap-add SYS_ADMIN
88105
target_devices: opencl:cpu
89-
tests_selector: e2e
90106

91107
- name: OCL CPU (Intel/Arc)
92108
runner: '["Linux", "arc"]'
93109
image_options: -u 1001
94110
target_devices: opencl:cpu
95-
tests_selector: e2e
96111
uses: ./.github/workflows/sycl-linux-run-tests.yml
97112
with:
98113
name: ${{ matrix.name }}
99114
runner: ${{ matrix.runner }}
100115
image_options: ${{ matrix.image_options }}
101116
target_devices: ${{ matrix.target_devices }}
102-
tests_selector: ${{ matrix.tests_selector }}
117+
tests_selector: e2e
103118
extra_lit_opts: "--param 'cxx_flags=-D_GLIBCXX_USE_CXX11_ABI=0' ${{ matrix.extra_lit_opts }}"
104119
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
105120
ref: ${{ github.sha }}

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ def ImplicitIntFloatConversion : DiagGroup<"implicit-int-float-conversion",
115115
[ImplicitConstIntFloatConversion]>;
116116
def ObjCSignedCharBoolImplicitFloatConversion :
117117
DiagGroup<"objc-signed-char-bool-implicit-float-conversion">;
118-
def ImplicitFloatSizeConversion :
119-
DiagGroup<"implicit-float-size-conversion">;
118+
def SyclImplicitFloatSizeConversion : DiagGroup<"sycl-implicit-float-size-conversion">;
120119
def ImplicitFloatConversion : DiagGroup<"implicit-float-conversion",
121120
[ImplicitIntFloatConversion,
122-
ObjCSignedCharBoolImplicitFloatConversion, ImplicitFloatSizeConversion]>;
121+
ObjCSignedCharBoolImplicitFloatConversion, SyclImplicitFloatSizeConversion]>;
123122
def ImplicitFixedPointConversion : DiagGroup<"implicit-fixed-point-conversion">;
124123

125124
def FloatOverflowConversion : DiagGroup<"float-overflow-conversion">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ def warn_float_compare_literal : Warning<
131131
def warn_double_const_requires_fp64 : Warning<
132132
"double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, "
133133
"casting to single precision">;
134-
def warn_imp_float_size_conversion : Warning<
134+
def warn_sycl_imp_float_size_conversion : Warning<
135135
"implicit conversion between floating point types of different sizes">,
136-
InGroup<ImplicitFloatSizeConversion>, DefaultIgnore;
136+
InGroup<SyclImplicitFloatSizeConversion>, DefaultIgnore;
137137
def err_half_const_requires_fp16 : Error<
138138
"half precision constant requires cl_khr_fp16">;
139139

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,17 +1169,17 @@ defm cx_fortran_rules: BoolOptionWithoutMarshalling<"f", "cx-fortran-rules",
11691169

11701170
defm offload_fp32_prec_div: BoolOption<"f", "offload-fp32-prec-div",
11711171
LangOpts<"OffloadFP32PrecDiv">, DefaultTrue,
1172-
PosFlag<SetTrue, [], [ClangOption, CC1Option], "fdiv operations in offload device "
1172+
PosFlag<SetTrue, [], [ClangOption, CLOption, CC1Option], "fdiv operations in offload device "
11731173
"code are required to return correctly rounded results.">,
1174-
NegFlag<SetFalse, [], [ClangOption, CC1Option], "fdiv operations in offload device "
1174+
NegFlag<SetFalse, [], [ClangOption, CLOption, CC1Option], "fdiv operations in offload device "
11751175
"code are not required to return correctly rounded results.">>,
11761176
Group<f_Group>;
11771177

11781178
defm offload_fp32_prec_sqrt: BoolOption<"f", "offload-fp32-prec-sqrt",
11791179
LangOpts<"OffloadFP32PrecSqrt">, DefaultTrue,
1180-
PosFlag<SetTrue, [], [ClangOption, CC1Option], "sqrt operations in offload device "
1180+
PosFlag<SetTrue, [], [ClangOption, CLOption, CC1Option], "sqrt operations in offload device "
11811181
"code are required to return correctly rounded results.">,
1182-
NegFlag<SetFalse, [], [ClangOption, CC1Option], "sqrt operations in offload device "
1182+
NegFlag<SetFalse, [], [ClangOption, CLOption, CC1Option], "sqrt operations in offload device "
11831183
"code are not required to return correctly rounded results.">>,
11841184
Group<f_Group>;
11851185

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10441044
/*FP64ConvEmu=*/CodeGenOpts.FP64ConvEmu,
10451045
/*ExcludeAspects=*/{"fp64"}));
10461046
MPM.addPass(SYCLPropagateJointMatrixUsagePass());
1047+
// Lowers static/dynamic local memory builtin calls.
1048+
MPM.addPass(SYCLLowerWGLocalMemoryPass());
10471049
});
10481050
else if (LangOpts.SYCLIsHost && !LangOpts.SYCLESIMDBuildHostCode)
10491051
PB.registerPipelineStartEPCallback(
@@ -1206,10 +1208,6 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
12061208
MPM.addPass(SPIRITTAnnotationsPass());
12071209
}
12081210

1209-
// Allocate static local memory in SYCL kernel scope for each allocation
1210-
// call.
1211-
MPM.addPass(SYCLLowerWGLocalMemoryPass());
1212-
12131211
// Process properties and annotations
12141212
MPM.addPass(CompileTimePropertiesPass());
12151213

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,8 @@ static llvm::SmallVector<StringRef, 16> SYCLDeviceLibList{
896896
"asan-cpu",
897897
"asan-dg2",
898898
"msan",
899+
"msan-pvc",
900+
"msan-cpu",
899901
#endif
900902
"imf",
901903
"imf-fp64",

clang/lib/Sema/SemaChecking.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11680,27 +11680,33 @@ void Sema::CheckImplicitConversion(Expr *E, QualType T, SourceLocation CC,
1168011680
result.Val,
1168111681
Context.getFloatTypeSemantics(QualType(TargetBT, 0)),
1168211682
Context.getFloatTypeSemantics(QualType(SourceBT, 0)))) {
11683-
if (getLangOpts().SYCLIsDevice)
11684-
SYCL().DiagIfDeviceCode(CC, diag::warn_imp_float_size_conversion);
11685-
else
11686-
DiagnoseImpCast(*this, E, T, CC,
11687-
diag::warn_imp_float_size_conversion);
11683+
if (getLangOpts().isSYCL()) {
11684+
if (getLangOpts().SYCLIsDevice)
11685+
SYCL().DiagIfDeviceCode(
11686+
CC, diag::warn_sycl_imp_float_size_conversion);
11687+
else
11688+
DiagnoseImpCast(*this, E, T, CC,
11689+
diag::warn_sycl_imp_float_size_conversion);
11690+
}
1168811691
return;
1168911692
}
1169011693
}
1169111694

1169211695
if (SourceMgr.isInSystemMacro(CC))
1169311696
return;
1169411697
// If there is a precision conversion between floating point types when
11695-
// -Wimplicit-float-size-conversion is passed but
11698+
// -Wsycl-implicit-float-size-conversion is passed but
1169611699
// -Wimplicit-float-conversion is not, make sure we emit at least a size
1169711700
// warning.
1169811701
if (Diags.isIgnored(diag::warn_impcast_float_precision, CC)) {
11699-
if (getLangOpts().SYCLIsDevice)
11700-
SYCL().DiagIfDeviceCode(CC, diag::warn_imp_float_size_conversion);
11701-
else
11702-
DiagnoseImpCast(*this, E, T, CC,
11703-
diag::warn_imp_float_size_conversion);
11702+
if (getLangOpts().isSYCL()) {
11703+
if (getLangOpts().SYCLIsDevice)
11704+
SYCL().DiagIfDeviceCode(
11705+
CC, diag::warn_sycl_imp_float_size_conversion);
11706+
else
11707+
DiagnoseImpCast(*this, E, T, CC,
11708+
diag::warn_sycl_imp_float_size_conversion);
11709+
}
1170411710
}
1170511711
DiagnoseImpCast(*this, E, T, CC, diag::warn_impcast_float_precision);
1170611712
}

clang/test/CodeGenSYCL/group-local-memory.cpp

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

clang/test/CodeGenSYCL/kernel-early-optimization-pipeline.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
// SYCL device target, and can be disabled with -fno-sycl-early-optimizations.
33
// New pass manager doesn't print all passes tree, only module level.
44
//
5-
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NEWPM-EARLYOPT
6-
// CHECK-NEWPM-EARLYOPT: ConstantMergePass
7-
// CHECK-NEWPM-EARLYOPT: SYCLMutatePrintfAddrspacePass
5+
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -o /dev/null 2>&1 | FileCheck %s
6+
// CHECK: SYCLVirtualFunctionsAnalysisPass
7+
// CHECK: ESIMDVerifierPass
8+
// CHECK: SYCLConditionalCallOnDevicePass
9+
// CHECK: SYCLPropagateAspectsUsagePass
10+
// CHECK: SYCLPropagateJointMatrixUsagePass
11+
// CHECK: SYCLLowerWGLocalMemoryPass
12+
// CHECK: InferFunctionAttrsPass
13+
// CHECK: AlwaysInlinerPass
14+
// CHECK: ModuleInlinerWrapperPass
15+
// CHECK: ConstantMergePass
16+
// CHECK: SYCLMutatePrintfAddrspacePass
17+
// CHECK: SYCLPropagateAspectsUsagePass
18+
// CHECK: SYCLAddOptLevelAttributePass
19+
// CHECK: CompileTimePropertiesPass
20+
// CHECK: RecordSYCLAspectNamesPass
21+
// CHECK: CleanupSYCLMetadataPass
822
//
9-
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -fno-sycl-early-optimizations -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NEWPM-NOEARLYOPT
10-
// CHECK-NEWPM-NOEARLYOPT-NOT: ConstantMergePass
11-
// CHECK-NEWPM-NOEARLYOPT: SYCLMutatePrintfAddrspacePass
12-
13-
// Checks that the compile time properties pass is added into the compilation pipeline
14-
//
15-
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-COMPTIMEPROPS
16-
// CHECK-COMPTIMEPROPS: Running pass: CompileTimePropertiesPass on [module]
23+
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -fno-sycl-early-optimizations -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NOEARLYOPT
24+
// CHECK-NOEARLYOPT-NOT: ConstantMergePass1
25+
// CHECK-NOEARLYOPT: SYCLMutatePrintfAddrspacePass

0 commit comments

Comments
 (0)