Skip to content

Commit 7960729

Browse files
committed
Merge branch 'sycl' into add_atomic64_decoration
2 parents 33d4714 + a497788 commit 7960729

File tree

283 files changed

+14885
-4782
lines changed

Some content is hidden

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

283 files changed

+14885
-4782
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ sycl/test-e2e/KernelFusion @intel/dpcpp-kernel-fusion-reviewers
126126
sycl/include/sycl/ext/oneapi/matrix/ @intel/sycl-matrix-reviewers
127127
sycl/test-e2e/Matrix @intel/sycl-matrix-reviewers
128128
sycl/test/matrix @intel/sycl-matrix-reviewers
129+
sycl/test/check_device_code/matrix @intel/sycl-matrix-reviewers
129130

130131
# Native CPU
131132
llvm/**/*SYCLNativeCPU* @intel/dpcpp-nativecpu-pi-reviewers

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919

2020
jobs:
2121
create-check:
22-
runs-on: [Linux, build]
22+
runs-on: [Linux, aux-tasks]
2323
permissions:
2424
checks: write
2525
statuses: write
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
name: CUDA E2E
6666
runner: '["aws_cuda-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}"]'
67-
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
67+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
6868
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
6969
target_devices: ext_oneapi_cuda:gpu
7070
# No idea why but that seems to work and be in sync with the main
@@ -79,7 +79,7 @@ jobs:
7979
update-check:
8080
needs: [create-check, e2e-cuda]
8181
if: always()
82-
runs-on: [Linux, build]
82+
runs-on: [Linux, aux-tasks]
8383
permissions:
8484
checks: write
8585
statuses: write

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
build_artifact_suffix: "default"
4747
build_cache_suffix: "default"
4848
changes: ${{ needs.detect_changes.outputs.filters }}
49+
build_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab"
4950

5051
determine_arc_tests:
5152
name: Decide which Arc tests to run
@@ -77,7 +78,7 @@ jobs:
7778
include:
7879
- name: AMD/HIP
7980
runner: '["Linux", "amdgpu"]'
80-
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
81+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
8182
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
8283
target_devices: ext_oneapi_hip:gpu
8384
- name: Intel

.github/workflows/sycl-nightly.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ jobs:
7474
target_devices: opencl:cpu
7575
tests_selector: e2e
7676

77-
- name: Self-hosted CUDA
78-
runner: '["Linux", "cuda"]'
79-
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
80-
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
81-
target_devices: ext_oneapi_cuda:gpu
82-
tests_selector: e2e
83-
8477
- name: SYCL-CTS on OCL CPU
8578
runner: '["Linux", "gen12"]'
8679
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8302,7 +8302,10 @@ let CategoryName = "Lambda Issue" in {
83028302
def note_var_explicitly_captured_here : Note<"variable %0 is"
83038303
"%select{| explicitly}1 captured here">;
83048304
def err_implicit_this_capture : Error<
8305-
"implicit capture of 'this' is not allowed for kernel functions">;
8305+
"implicit capture of 'this' is not allowed for kernel functions. "
8306+
"Either ensure the object is allocated in the memory available "
8307+
"on the device (e.g., shared USM memory) and capture it explicitly "
8308+
"or consider capturing the current object by copy ([*this]).">;
83068309
def err_lambda_member_access : Error<
83078310
"invalid attempt to access member of lambda">;
83088311

clang/lib/AST/ASTContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12035,10 +12035,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
1203512035
// or `indirectly_callable' attribute must be emitted regardless of number
1203612036
// of actual uses
1203712037
if (LangOpts.SYCLIsDevice && isa<CXXMethodDecl>(D)) {
12038-
if (auto *A = D->getAttr<SYCLDeviceIndirectlyCallableAttr>())
12039-
return !A->isImplicit();
12040-
if (auto *A = D->getAttr<SYCLDeviceAttr>())
12041-
return !A->isImplicit();
12038+
if (D->hasAttr<SYCLDeviceIndirectlyCallableAttr>())
12039+
return true;
12040+
if (D->hasAttr<SYCLDeviceAttr>())
12041+
return true;
1204212042
}
1204312043

1204412044
GVALinkage Linkage = GetGVALinkageForFunction(FD);

clang/lib/Basic/Targets/NVPTX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts,
286286
Builder.defineMacro("__SYCL_CUDA_ARCH__", CUDAArchCode);
287287
} else {
288288
Builder.defineMacro("__CUDA_ARCH__", CUDAArchCode);
289-
if (GPU == CudaArch::SM_90a)
290-
Builder.defineMacro("__CUDA_ARCH_FEAT_SM90_ALL", "1");
291289
}
290+
if (GPU == CudaArch::SM_90a)
291+
Builder.defineMacro("__CUDA_ARCH_FEAT_SM90_ALL", "1");
292292
}
293293
}
294294

clang/lib/Driver/Compilation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ bool Compilation::CleanupFile(const char *File, bool IssueErrors) const {
198198
// when the nvptx*-nvidia-cuda is passed to -fsycl-targets.
199199
if (DefaultToolChain.getTriple().isNVPTX())
200200
return false;
201-
if (llvm::sys::path::extension(ActualFile).equals(".spv"))
201+
if (llvm::sys::path::extension(ActualFile) == ".spv")
202202
return false;
203203
}
204204
}

clang/lib/Driver/Driver.cpp

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,8 @@ static bool isValidSYCLTriple(llvm::Triple T) {
829829
// SPIR/SPIRV arch, but has invalid SubArch for AOT.
830830
StringRef A(T.getArchName());
831831
if (T.getSubArch() == llvm::Triple::NoSubArch &&
832-
((T.getArch() == llvm::Triple::spir && !A.equals("spir")) ||
833-
(T.getArch() == llvm::Triple::spir64 && !A.equals("spir64"))))
832+
((T.getArch() == llvm::Triple::spir && A != "spir") ||
833+
(T.getArch() == llvm::Triple::spir64 && A != "spir64")))
834834
return false;
835835
return true;
836836
}
@@ -1149,7 +1149,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
11491149
return;
11501150
const char *ArgValue = A->getValue();
11511151
for (const StringRef AllowedValue : AllowedValues)
1152-
if (AllowedValue.equals(ArgValue))
1152+
if (AllowedValue == ArgValue)
11531153
return;
11541154
Diag(clang::diag::err_drv_invalid_argument_to_option)
11551155
<< ArgValue << A->getOption().getName();
@@ -1182,6 +1182,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
11821182
// of -fsycl*target options passed
11831183
Arg *SYCLTargetsValues = SYCLTargets;
11841184
if (SYCLTargetsValues) {
1185+
llvm::StringSet<> SYCLTriples;
11851186
if (SYCLTargetsValues->getNumValues()) {
11861187

11871188
// Multiple targets are currently not supported when using
@@ -1220,7 +1221,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12201221
const ToolChain *HostTC =
12211222
C.getSingleOffloadToolChain<Action::OFK_Host>();
12221223
llvm::Triple HostTriple = HostTC->getTriple();
1223-
UniqueSYCLTriplesVec.push_back(HostTriple);
1224+
SYCLTriples.insert(HostTriple.normalize());
12241225
continue;
12251226
}
12261227

@@ -1242,10 +1243,16 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12421243
// the following iterations.
12431244
FoundNormalizedTriples[NormalizedName] = Val;
12441245
llvm::Triple DeviceTriple(MakeSYCLDeviceTriple(UserTargetName));
1245-
UniqueSYCLTriplesVec.push_back(DeviceTriple);
1246+
SYCLTriples.insert(DeviceTriple.normalize());
12461247
if (!Arch.empty())
12471248
DerivedArchs[DeviceTriple.getTriple()].insert(Arch);
12481249
}
1250+
if (!SYCLTriples.empty()) {
1251+
for (const auto &SYCLTriple : SYCLTriples) {
1252+
llvm::Triple Triple(SYCLTriple.getKey());
1253+
UniqueSYCLTriplesVec.push_back(Triple);
1254+
}
1255+
}
12491256
addSYCLDefaultTriple(C, UniqueSYCLTriplesVec);
12501257
} else
12511258
Diag(clang::diag::warn_drv_empty_joined_argument)
@@ -1891,7 +1898,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
18911898
// an external option setting is required to target hardware.
18921899
setOffloadCompileMode(FPGAEmulationMode);
18931900
for (StringRef ArgString : TargetArgs) {
1894-
if (ArgString.equals("-hardware") || ArgString.equals("-simulation")) {
1901+
if (ArgString == "-hardware" || ArgString == "-simulation") {
18951902
setOffloadCompileMode(FPGAHWMode);
18961903
break;
18971904
}
@@ -5031,17 +5038,16 @@ class OffloadingActionBuilder final {
50315038
}
50325039

50335040
// By default, we produce an action for each device arch.
5034-
auto TC = ToolChains.begin();
5035-
for (Action *&A : SYCLDeviceActions) {
5036-
if ((*TC)->getTriple().isNVPTX() && CurPhase >= phases::Backend) {
5041+
for (auto TargetActionInfo :
5042+
llvm::zip(SYCLDeviceActions, SYCLTargetInfoList)) {
5043+
auto &TargetInfo = std::get<1>(TargetActionInfo);
5044+
if (TargetInfo.TC->getTriple().isNVPTX() && CurPhase >= phases::Backend)
50375045
// For CUDA, stop to emit LLVM IR so it can be linked later on.
5038-
++TC;
50395046
continue;
5040-
}
50415047

5048+
Action *&A = std::get<0>(TargetActionInfo);
50425049
A = C.getDriver().ConstructPhaseAction(C, Args, CurPhase, A,
50435050
AssociatedOffloadKind);
5044-
++TC;
50455051
}
50465052

50475053
return ABRT_Success;
@@ -6250,12 +6256,12 @@ class OffloadingActionBuilder final {
62506256
using namespace tools::SYCL;
62516257
StringRef Device{Value.first};
62526258
if (Device.consume_front(gen::AmdGPU))
6253-
return TargetArch.equals(Device) && TargetTriple.isAMDGCN();
6259+
return TargetArch == Device && TargetTriple.isAMDGCN();
62546260
if (Device.consume_front(gen::NvidiaGPU))
6255-
return TargetArch.equals(Device) && TargetTriple.isNVPTX();
6261+
return TargetArch == Device && TargetTriple.isNVPTX();
62566262
if (Device.consume_front(gen::IntelGPU))
6257-
return TargetArch.equals(Device) && TargetTriple.isSPIRAOT();
6258-
return TargetArch.equals(Device) && isValidSYCLTriple(TargetTriple);
6263+
return TargetArch == Device && TargetTriple.isSPIRAOT();
6264+
return TargetArch == Device && isValidSYCLTriple(TargetTriple);
62596265
});
62606266
} else {
62616267
TargetIt = TargetTable.find(TargetTriple.str());
@@ -9710,7 +9716,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
97109716
const auto &ResultFiles = C.getResultFiles();
97119717
const auto CollidingFilenameIt =
97129718
llvm::find_if(ResultFiles, [NamedOutput](const auto &It) {
9713-
return StringRef(NamedOutput).equals(It.second);
9719+
return StringRef(NamedOutput) == It.second;
97149720
});
97159721
if (CollidingFilenameIt != ResultFiles.end()) {
97169722
// Upon any collision, a unique hash will be appended to the filename,

0 commit comments

Comments
 (0)