Skip to content

Commit 7996d84

Browse files
committed
Remove superfluous C++ linkage specification from assert headers
2 parents 58fe4c5 + d29060e commit 7996d84

File tree

180 files changed

+3808
-1582
lines changed

Some content is hidden

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

180 files changed

+3808
-1582
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ jobs:
8383
- name: Intel
8484
runner: '["Linux", "gen12"]'
8585
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
86-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
86+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
8787
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
8888
reset_intel_gpu: true
8989
extra_lit_opts: --param gpu-intel-gen12=True
9090
- name: E2E tests on Intel Arc A-Series Graphics
9191
runner: '["Linux", "arc"]'
9292
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
93-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
93+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
9494
target_devices: level_zero:gpu;opencl:gpu
9595
reset_intel_gpu: true
9696
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
9797
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
9898
- name: E2E tests with dev igc on Intel Arc A-Series Graphics
9999
runner: '["Linux", "arc"]'
100100
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:devigc
101-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
101+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
102102
target_devices: level_zero:gpu;opencl:gpu
103103
reset_intel_gpu: true
104104
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
@@ -117,11 +117,11 @@ jobs:
117117
env: ${{ matrix.env || '{}' }}
118118

119119
# Do not install drivers on AMD and CUDA runners.
120-
install_igc_driver: |
120+
install_igc_driver: >-
121121
${{ !contains(matrix.target_devices, 'ext_oneapi_cuda') &&
122122
!contains(matrix.target_devices, 'ext_oneapi_hip') &&
123123
contains(needs.detect_changes.outputs.filters, 'drivers') }}
124-
install_dev_igc_driver: |
124+
install_dev_igc_driver: >-
125125
${{ !contains(matrix.target_devices, 'ext_oneapi_cuda') &&
126126
!contains(matrix.target_devices, 'ext_oneapi_hip') &&
127127
matrix.use_igc_dev && contains(needs.detect_changes.outputs.filters, 'devigccfg') ||

.github/workflows/sycl-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Intel L0 GPU
5454
runner: '["Linux", "gen12"]'
5555
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
56-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
56+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
5757
target_devices: level_zero:gpu
5858
reset_intel_gpu: true
5959
tests_selector: e2e
@@ -62,7 +62,7 @@ jobs:
6262
- name: Intel OCL GPU
6363
runner: '["Linux", "gen12"]'
6464
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
65-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
65+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
6666
target_devices: opencl:gpu
6767
reset_intel_gpu: true
6868
tests_selector: e2e

.github/workflows/sycl-post-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
name: ${{ matrix.name }}
8888
runner: ${{ matrix. runner }}
8989
image: ${{ matrix.image || 'ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest' }}
90-
image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN' }}
90+
image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN' }}
9191
target_devices: ${{ matrix.target_devices || 'level_zero:gpu' }}
9292
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
9393

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ jobs:
8686
# Run E2E tests.
8787
export LIT_OPTS="-v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests ${{ inputs.extra_lit_opts }}"
8888
cmake --build build-e2e --target check-sycl-e2e
89+
- name: Detect hung tests
90+
shell: powershell
91+
run: |
92+
$exitCode = 0
93+
$hungTests = Get-Process | Where-Object { ($_.Path -match "llvm\\install") -or ($_.Path -match "llvm\\build-e2e") }
94+
$hungTests | Foreach-Object {
95+
$exitCode = 1
96+
echo "Test $($_.Path) hung!"
97+
Stop-Process -Force $_
98+
}
99+
exit $exitCode
89100
- name: Cleanup
90101
shell: cmd
91102
if: always()

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ LANGOPT(SYCLAllowFuncPtr , 1, 0, "Allow function pointers in SYCL device code")
307307
LANGOPT(SYCLStdLayoutKernelParams, 1, 0, "Enable standard layout requirement for SYCL kernel parameters")
308308
LANGOPT(SYCLUnnamedLambda , 1, 0, "Allow unnamed lambda SYCL kernels")
309309
LANGOPT(SYCLForceInlineKernelLambda , 1, 0, "Force inline SYCL kernel lambdas in entry point")
310-
LANGOPT(SYCLAllowAllFeaturesInConstexpr, 1, 0, "Allow all C++ features in SYCL device code in manifestly constant-evaluated expressions")
311310
LANGOPT(SYCLESIMDForceStatelessMem, 1, 0, "Make accessors use USM memory in ESIMD kernels")
312311
LANGOPT(SYCLESIMDBuildHostCode, 1, 1, "Build the host implementation of ESIMD functions")
313312
ENUM_LANGOPT(SYCLVersion , SYCLMajorVersion, 2, SYCL_None, "Version of the SYCL standard used")

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8628,11 +8628,6 @@ def fsycl_is_native_cpu : Flag<["-"], "fsycl-is-native-cpu">,
86288628
HelpText<"Perform device compilation for Native CPU.">,
86298629
Visibility<[CC1Option]>,
86308630
MarshallingInfoFlag<LangOpts<"SYCLIsNativeCPU">>;
8631-
defm sycl_allow_all_features_in_constexpr
8632-
: BoolFOption<
8633-
"sycl-allow-all-features-in-constexpr", LangOpts<"SYCLAllowAllFeaturesInConstexpr">,
8634-
DefaultFalse,
8635-
PosFlag<SetTrue, [], [CC1Option], "Allow all C++ features in SYCL device code in manifestly constant-evaluated expressions">, NegFlag<SetFalse>>;
86368631

86378632
} // let Visibility = [CC1Option]
86388633

clang/lib/Driver/Driver.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6350,7 +6350,7 @@ class OffloadingActionBuilder final {
63506350
if (GpuInitHasErrors)
63516351
return true;
63526352

6353-
int I = 0;
6353+
int GenIndex = 0;
63546354
// Fill SYCLTargetInfoList
63556355
for (auto &TT : SYCLTripleList) {
63566356
auto TCIt = llvm::find_if(
@@ -6363,10 +6363,21 @@ class OffloadingActionBuilder final {
63636363
// is the target device.
63646364
if (TT.isSPIR() &&
63656365
TT.getSubArch() == llvm::Triple::SPIRSubArch_gen) {
6366-
StringRef Device(GpuArchList[I].second);
6366+
// Multiple spir64_gen targets are allowed to be used via the
6367+
// -fsycl-targets=spir64_gen and -fsycl-targets=intel_gpu_*
6368+
// specifiers. Using an index through the known GpuArchList
6369+
// values, increment through them accordingly to allow for
6370+
// the multiple settings as well as preventing re-use.
6371+
while (TT != GpuArchList[GenIndex].first &&
6372+
GenIndex < GpuArchList.size())
6373+
++GenIndex;
6374+
if (GpuArchList[GenIndex].first != TT)
6375+
// No match.
6376+
continue;
6377+
StringRef Device(GpuArchList[GenIndex].second);
63676378
SYCLTargetInfoList.emplace_back(
63686379
*TCIt, Device.empty() ? nullptr : Device.data());
6369-
++I;
6380+
++GenIndex;
63706381
continue;
63716382
}
63726383
SYCLTargetInfoList.emplace_back(*TCIt, nullptr);
@@ -6380,7 +6391,6 @@ class OffloadingActionBuilder final {
63806391
}
63816392
assert(OffloadArch && "Failed to find matching arch.");
63826393
SYCLTargetInfoList.emplace_back(*TCIt, OffloadArch);
6383-
++I;
63846394
}
63856395
}
63866396
}

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ const char *SYCL::Linker::constructLLVMLinkCommand(
579579
auto isSYCLDeviceLib = [&](const InputInfo &II) {
580580
const ToolChain *HostTC = C.getSingleOffloadToolChain<Action::OFK_Host>();
581581
const bool IsNVPTX = this->getToolChain().getTriple().isNVPTX();
582+
const bool IsAMDGCN = this->getToolChain().getTriple().isAMDGCN();
582583
const bool IsFPGA = this->getToolChain().getTriple().isSPIR() &&
583584
this->getToolChain().getTriple().getSubArch() ==
584585
llvm::Triple::SPIRSubArch_fpga;
@@ -598,6 +599,9 @@ const char *SYCL::Linker::constructLLVMLinkCommand(
598599
// NativeCPU links against libclc (libspirv)
599600
if (IsSYCLNativeCPU && InputFilename.contains("libspirv"))
600601
return true;
602+
// AMDGCN links against our libdevice (devicelib)
603+
if (IsAMDGCN && InputFilename.starts_with("devicelib-"))
604+
return true;
601605
// NVPTX links against our libclc (libspirv), our libdevice (devicelib),
602606
// and the CUDA libdevice
603607
if (IsNVPTX && (InputFilename.starts_with("devicelib-") ||

clang/lib/Sema/Sema.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ class DeferredDiagnosticsEmitter
18291829
}
18301830

18311831
void VisitDeclStmt(DeclStmt *DS) {
1832-
if (S.getLangOpts().SYCLAllowAllFeaturesInConstexpr) {
1832+
if (S.getLangOpts().SYCLIsDevice) {
18331833
if (DS->isSingleDecl()) {
18341834
Decl *D = DS->getSingleDecl();
18351835
if (auto *VD = dyn_cast<VarDecl>(D))
@@ -1850,7 +1850,7 @@ class DeferredDiagnosticsEmitter
18501850
}
18511851

18521852
void VisitConstantExpr(ConstantExpr *E) {
1853-
if (S.getLangOpts().SYCLAllowAllFeaturesInConstexpr)
1853+
if (S.getLangOpts().SYCLIsDevice)
18541854
return;
18551855
this->VisitStmt(E);
18561856
}
@@ -2264,7 +2264,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
22642264

22652265
CheckType(Ty);
22662266
if (const auto *FD = dyn_cast_if_present<FunctionDecl>(D)) {
2267-
if (LangOpts.SYCLAllowAllFeaturesInConstexpr && FD->isConsteval())
2267+
if (LangOpts.SYCLIsDevice && FD->isConsteval())
22682268
return;
22692269
if (const auto *FPTy = dyn_cast<FunctionProtoType>(Ty)) {
22702270
for (const auto &ParamTy : FPTy->param_types())

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18418,7 +18418,7 @@ void Sema::ActOnCXXEnterDeclInitializer(Scope *S, Decl *D) {
1841818418

1841918419
if (auto *VD = dyn_cast<VarDecl>(D);
1842018420
VD && (VD->mightBeUsableInConstantExpressions(Context)))
18421-
InConstexprVarInit = LangOpts.SYCLAllowAllFeaturesInConstexpr;
18421+
InConstexprVarInit = true;
1842218422
PushExpressionEvaluationContext(
1842318423
ExpressionEvaluationContext::PotentiallyEvaluated, D);
1842418424
}

0 commit comments

Comments
 (0)