Skip to content

[SYCL] Cleanup/refactor device_code_tests #14063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
9f94263
[SYCL] Changed some check_device_code lit tests to use SYCL_EXTERNAL
ianayl May 23, 2024
5fb2b92
[SYCL] Changed more check_device_code lit tests to use SYCL_EXTERNAL
ianayl Jun 5, 2024
78d0169
Merge branch 'sycl' of https://github.com/intel/llvm into SYCLEXTERNA…
ianayl Jun 5, 2024
983fb4b
[SYCL} Temporarily revert changes to select check_device_code lit tests
ianayl Jun 6, 2024
f47da5c
[SYCL] Simplified some lit tests in check_device_code
ianayl Jun 6, 2024
3521682
[SYCL] Move group_ballot.cpp into sycl/test/extensions
ianayl Jun 6, 2024
a081f88
[SYCL] Remove redundant includes in check_device_code/ap_fixed.cpp
ianayl Jun 7, 2024
01c7b1a
[SYCL] Revert certain check_device_code tests to use queues instead
ianayl Jun 7, 2024
65e81c7
[SYCL] Split check_device_code/device_has.cpp into a function version…
ianayl Jun 7, 2024
a47bc04
[SYCL] Move non device code checks out of check_device_code, and refa…
ianayl Jun 11, 2024
736eb1b
[ESIMD] Allow full autodeduction for prefetch APIs accepting simd_vie…
fineg74 Jun 5, 2024
05b29ef
[SYCL] Disable flaky test EnqueueNoMemObjTwoHostTasks on Windows (#14…
sarnex Jun 5, 2024
95edc70
[SYCL][Joint Matrix] Test combinations are queried Part 3 (#13991)
artemrad Jun 6, 2024
b1dc13a
[SYCL][Joint Matrix] Test combinations are queried Part 4 (#14019)
artemrad Jun 6, 2024
874846e
[SYCL][Graph] Clarify graph enable_profiling property in finalize() (…
guoyejun Jun 6, 2024
eeac017
[SYCL] Force-emit more member functions into device code (#13985)
AlexeySachkov Jun 6, 2024
91f78bd
[SYCL][COMPAT] Added filter_device and list_devices (#14016)
Alcpz Jun 6, 2024
c1687a5
[SYCL][COMPAT] Add wait_and_free plus rename async_free in syclcompat…
AidanBeltonS Jun 6, 2024
3396907
[SYCL][TEST-E2E] Disallow `dep_events.cpp` test built for CUDA backen…
mmoadeli Jun 6, 2024
b0572cb
[CI] pre-commit/aws pointed back to old image. (#14074)
JackAKirk Jun 6, 2024
125c771
[SYCL][TEST-E2E] Refactor the test to address Windows not printing th…
mmoadeli Jun 6, 2024
034236c
[SYCL][TEST-E2E] Extend `sycl-ls-gpu-default.cpp` test to cover Inte…
mmoadeli Jun 6, 2024
7c6c0dd
[SYCL][E2E] Refactor/fix bfloat16 test (#14062)
aelovikov-intel Jun 6, 2024
2f8a39d
[SYCL][E2E] Disable NonUniformGroups/ballot_group_algorithms.cpp on C…
aelovikov-intel Jun 6, 2024
54355e0
[SYCL][E2E] Remove warnings in Basic e2e tests (#13994)
ayylol Jun 6, 2024
d9f6097
[Doc] Add Mar'24 Release Notes (#13879)
uditagarwal97 Jun 6, 2024
fd43f02
[ESIMD] Allow full autodeduction of template parameters for atomic_up…
fineg74 Jun 6, 2024
fee74b1
[ESIMD] Allow full autodeduction of template parameters for atomic_up…
fineg74 Jun 6, 2024
5f3866a
[SYCL][E2E] Disable memory_management_test3.cpp on Gen12 linux (#14087)
sarnex Jun 6, 2024
e6418d9
[SYCL][Matrix] Amend CODEOWNERS for check_device_code matrix tests (#…
ianayl Jun 6, 2024
0d3ecc4
[CI] Don't run E2E tests on self-hosted CUDA in Nightly (#14041)
aelovikov-intel Jun 6, 2024
f7653cb
[SYCL] Add `vec<bfloat16>` support to math builtins (#14002)
uditagarwal97 Jun 7, 2024
2e51c65
[SYCL] Change check_device_code CUDA tests to use SYCL_EXTERNAL (#13943)
ianayl Jun 7, 2024
f732ef3
[SYCL][Bindless] Enable non-Vulkan tests on Windows (#14045)
ProGTX Jun 7, 2024
089dafc
[SYCL][HIP] Remove unsupported from O0 tests on AMD (#13967)
npmiller Jun 7, 2024
48c4c0b
[NFCI][SYCL] Move SYCL Module Splitting to library. Part 2 (#13282)
maksimsab Jun 7, 2024
dfbf258
[SYCL][COMPAT] Add math `extend_v*2` to SYCLCompat (#13953)
OuadiElfarouki Jun 7, 2024
7a940f2
[ESIMD]Replace use of vc intrinsic with spirv extension for rdtsc API…
fineg74 Jun 7, 2024
a26c7fb
[SYCL][Docs] Move sycl_ext_oneapi_enqueue_functions to experimental (…
steffenlarsen Jun 7, 2024
e8f0bb3
[SYCL][ESIMD][E2E] Fix bit shift vector test to not use c++20 (#14081)
sarnex Jun 7, 2024
f642cd3
[SYCL][ESIMD] Instruction count performance test (#14033)
jasonlizhengjian Jun 7, 2024
c726fd1
[SYCL] Record aspect names when computing device requirements (#13974)
jzc Jun 7, 2024
fbcb8bd
[SYCL][Doc] Extension spec for "work_group_memory" (#13725)
gmlueck Jun 7, 2024
e9ba164
[SYCL][E2E] Remove uses of OpenCL primitives in Basic/image e2e tests…
ayylol Jun 7, 2024
001d8fb
[SYCL] Fix post-commit issue with library dependencies (#14094)
AlexeySachkov Jun 7, 2024
649453d
[SYCL] Restrict `sycl::vec` and swizzle operations to types mentioned…
uditagarwal97 Jun 7, 2024
caaa88c
[SYCL] Fix UB and alignment issues in the SYCL default sorter (#13975)
againull Jun 8, 2024
77c2a78
[SYCL][E2E] Remove use of deprecated exceptions in USM e2e tests (#14…
ayylol Jun 8, 2024
04e4ee3
[SYCL][COMPAT] Fix memory_management_test3 (#14080)
AidanBeltonS Jun 10, 2024
a56c680
[SYCL][Graph] fix the address pointer in graph print (#13595)
guoyejun Jun 10, 2024
a5e6d68
[SYCL][Graph] Missing test dependency after data init (#14092)
EwanC Jun 10, 2024
5f41693
[SYCL][COMPAT] Added two-way and four-way dot product accumulate (dp4…
Alcpz Jun 10, 2024
52111a7
[UR] Bump main tag to f06bc02a (#14047)
kbenzie Jun 10, 2024
9f76cfb
[SYCL][E2E] Disable ProfilingTag tests on CUDA (#14073)
steffenlarsen Jun 10, 2024
c1853cb
[SYCL][Graph] Combined L0 Graph Update fixes (#14111)
EwanC Jun 10, 2024
10958fa
[SYCL][Graph] Disable flaky Windows test (#14070)
EwanC Jun 10, 2024
43a0eb2
[UR] Remove redundant mem type (#13058)
omarahmed1111 Jun 10, 2024
8632f90
[SYCL] Initial changes for the second version of sycl_ext_oneapi_grou…
againull Jun 10, 2024
829ff92
[SYCL] Change check_device_code HIP tests to use SYCL_EXTERNAL (#13990)
ianayl Jun 10, 2024
42f2e49
[Clang] Clarify error for implicit `this` capture in a kernel (#14100)
aelovikov-intel Jun 10, 2024
640e8db
[SYCL] Add sm90a Cuda target architecture support (#14075)
GeorgeWeb Jun 10, 2024
d5fcbe9
[ESIMD]Enable tests for DG2 (#14099)
fineg74 Jun 10, 2024
9af1fb0
[SYCL][E2E] Disable discard_events_l0_inorder.cpp on Arc (#14122)
sarnex Jun 10, 2024
64914a2
[Driver][SYCL][NewOffload] Update option passing for packager and AOT…
mdtoguchi Jun 10, 2024
e6872f1
[Driver][NFC] Update equals usage in driver sources (#14090)
mdtoguchi Jun 10, 2024
5407ac6
[GHA] Uplift Linux IGC Dev RT version to igc-dev-3bd1d5e (#14107)
bb-sycl Jun 10, 2024
e15729e
[NFC][SYCL] Minor refactoring in `sycl::vec<>` (#13949)
uditagarwal97 Jun 10, 2024
63f811c
[Driver][SYCL][NewOffload] Fix duplication of device targets (#14091)
mdtoguchi Jun 10, 2024
3df8223
[SYCL][Graph] 3D kernel update regression test (#14110)
EwanC Jun 11, 2024
df02093
[SYCL] Introduce new properties for virtual functions (#14014)
AlexeySachkov Jun 11, 2024
1e07f59
[SYCL][Docs] fix a typo in sycl_ext_oneapi_profiling_tag (#14133)
guoyejun Jun 11, 2024
88560c4
[SYCL][COMPAT] Add bfe_safe and bfi_safe APIs (#14006)
joeatodd Jun 11, 2024
8c284b6
[SYCL][COMPAT] Migrate currently unsupported memcpy_parameter overloa…
joeatodd Jun 11, 2024
8cfa566
Revert "[Driver][SYCL][NewOffload] Fix duplication of device targets"…
steffenlarsen Jun 11, 2024
ba5e9ca
[New offload driver][sycl-post-link] Move sycl-post-link target speci…
asudarsa Jun 11, 2024
88851d5
[CI] Allow aux CUDA jobs to run on more machines (#14124)
sarnex Jun 11, 2024
de58e29
[Driver][SYCL][NewOffload] Fix duplication of device targets (#14143)
mdtoguchi Jun 11, 2024
6f4d939
[New offload driver][Device lib] Add SYCL device library files for al…
asudarsa Jun 11, 2024
fb22562
[SYCL] Enable CET for wqlibsycl-devicelib-host.a (#14135)
jinge90 Jun 12, 2024
df6eaad
[UR] Fix size confusion for several device property queries (#12488)
al42and Jun 12, 2024
b54aefe
[SYCL][COMPAT] Added non-const image2d_max and image3d_max getters (#…
Alcpz Jun 12, 2024
03b2e21
[SYCL][Graph] Update L0 aspect test (#14093)
EwanC Jun 12, 2024
75bfeac
[SYCL][E2E] Fix CUDA include and lib paths. (#14118)
mmoadeli Jun 12, 2024
8e445ed
[UR] Bump main tag to 78d02039 (#12269)
aarongreig Jun 12, 2024
1e0efd8
[SYCL][COMPAT] Add math extend_v*4 to SYCLCompat (#14078)
OuadiElfarouki Jun 12, 2024
f226ce3
[SYCL] Remove unneeded parameter from `getOrInsertMemObjRecord` (#13807)
sergey-semenov Jun 12, 2024
284f419
[E2E] Modify commands to address running on Windows. (#13682)
mmoadeli Jun 12, 2024
5d94708
[SYCL][E2E] Fix deprecated warnings in `InorderQueue` e2e tests (#14120)
ayylol Jun 12, 2024
ca32941
[UR] Update UR tag to include L0 loader related changes (#14109)
againull Jun 12, 2024
69186a8
[UR] Bump main tag to b13c5e1f (#14042)
hdelan Jun 12, 2024
c394f03
[SYCL] Remove redundant code from L0 plugin's cmake file (#14108)
againull Jun 12, 2024
f8f109a
[SYCL] Add support for key/value sorting APIs (#13942)
againull Jun 12, 2024
f625bde
[SYCL][NewOffload][E2E] add a single test for --offload-new-driver (#…
jasonlizhengjian Jun 12, 2024
82ea253
[SYCL] [libdevice] Add vector overloads of ConvertBFloat16ToFINTEL an…
uditagarwal97 Jun 12, 2024
a48a126
[SYCL] Use `std::array` as storage for `sycl::vec` on device (#14130)
uditagarwal97 Jun 12, 2024
fd07268
[SYCL] Adding support for missing math ops (#14132)
MaryaSharf Jun 13, 2024
80eb9f5
[Doc] Document Unified Runtime update process (#14097)
kbenzie Jun 13, 2024
292fdda
[SYCL] Disable in-order queue barrier optimization while profiling (#…
sergey-semenov Jun 13, 2024
bf585a0
[SYCL] Add atomic64 aspect decoration to atomic_ref<T *> (#14052)
maksimsab Jun 13, 2024
5a68a78
[SYCL] Clear cache in case of PI_ERROR_OUT_OF_HOST_MEMORY (#14119)
KornevNikita Jun 13, 2024
c3eadc9
[CI] Turn on sycl-cts/test_accessor in Nightly (#14159)
KornevNikita Jun 13, 2024
11df203
[GHA] Uplift Linux IGC Dev RT version to igc-dev-480f8b6 (#14155)
bb-sycl Jun 13, 2024
d7622c1
[SYCL] Fix FloatVecToBF16Vec build (#14161)
npmiller Jun 13, 2024
1ce91da
Bump braces from 3.0.2 to 3.0.3 in /mlir/utils/vscode (#14144)
dependabot[bot] Jun 13, 2024
e533d5d
[CLC][AMDGPU] Refactor fence helper to process order semantic explici…
GeorgeWeb Jun 13, 2024
e194ce1
[SYCL] Re-enable `Basic/barrier_order.cpp` (#14154)
aelovikov-intel Jun 13, 2024
242fe06
[SYCL][ESIMD][E2E] Fix rotate.cpp on Windows (#14152)
sarnex Jun 13, 2024
abfd64a
[Driver][SYCL][NewOffloadModel] Incorporate -device settings for GPU …
mdtoguchi Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ sycl/test-e2e/KernelFusion @intel/dpcpp-kernel-fusion-reviewers
sycl/include/sycl/ext/oneapi/matrix/ @intel/sycl-matrix-reviewers
sycl/test-e2e/Matrix @intel/sycl-matrix-reviewers
sycl/test/matrix @intel/sycl-matrix-reviewers
sycl/test/check_device_code/matrix @intel/sycl-matrix-reviewers

# Native CPU
llvm/**/*SYCLNativeCPU* @intel/dpcpp-nativecpu-pi-reviewers
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sycl-linux-precommit-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions:

jobs:
create-check:
runs-on: [Linux, build]
runs-on: [Linux, aux-tasks]
permissions:
checks: write
statuses: write
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
with:
name: CUDA E2E
runner: '["aws_cuda-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
target_devices: ext_oneapi_cuda:gpu
# No idea why but that seems to work and be in sync with the main
Expand All @@ -79,7 +79,7 @@ jobs:
update-check:
needs: [create-check, e2e-cuda]
if: always()
runs-on: [Linux, build]
runs-on: [Linux, aux-tasks]
permissions:
checks: write
statuses: write
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
build_artifact_suffix: "default"
build_cache_suffix: "default"
changes: ${{ needs.detect_changes.outputs.filters }}
build_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab"

determine_arc_tests:
name: Decide which Arc tests to run
Expand Down Expand Up @@ -77,7 +78,7 @@ jobs:
include:
- name: AMD/HIP
runner: '["Linux", "amdgpu"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
target_devices: ext_oneapi_hip:gpu
- name: Intel
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ jobs:
target_devices: opencl:cpu
tests_selector: e2e

- name: Self-hosted CUDA
runner: '["Linux", "cuda"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
target_devices: ext_oneapi_cuda:gpu
tests_selector: e2e

- name: SYCL-CTS on OCL CPU
runner: '["Linux", "gen12"]'
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
Expand Down
5 changes: 4 additions & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -8302,7 +8302,10 @@ let CategoryName = "Lambda Issue" in {
def note_var_explicitly_captured_here : Note<"variable %0 is"
"%select{| explicitly}1 captured here">;
def err_implicit_this_capture : Error<
"implicit capture of 'this' is not allowed for kernel functions">;
"implicit capture of 'this' is not allowed for kernel functions. "
"Either ensure the object is allocated in the memory available "
"on the device (e.g., shared USM memory) and capture it explicitly "
"or consider capturing the current object by copy ([*this]).">;
def err_lambda_member_access : Error<
"invalid attempt to access member of lambda">;

Expand Down
8 changes: 4 additions & 4 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12035,10 +12035,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
// or `indirectly_callable' attribute must be emitted regardless of number
// of actual uses
if (LangOpts.SYCLIsDevice && isa<CXXMethodDecl>(D)) {
if (auto *A = D->getAttr<SYCLDeviceIndirectlyCallableAttr>())
return !A->isImplicit();
if (auto *A = D->getAttr<SYCLDeviceAttr>())
return !A->isImplicit();
if (D->hasAttr<SYCLDeviceIndirectlyCallableAttr>())
return true;
if (D->hasAttr<SYCLDeviceAttr>())
return true;
}

GVALinkage Linkage = GetGVALinkageForFunction(FD);
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Basic/Targets/NVPTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__SYCL_CUDA_ARCH__", CUDAArchCode);
} else {
Builder.defineMacro("__CUDA_ARCH__", CUDAArchCode);
if (GPU == CudaArch::SM_90a)
Builder.defineMacro("__CUDA_ARCH_FEAT_SM90_ALL", "1");
}
if (GPU == CudaArch::SM_90a)
Builder.defineMacro("__CUDA_ARCH_FEAT_SM90_ALL", "1");
}
}

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Driver/Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ bool Compilation::CleanupFile(const char *File, bool IssueErrors) const {
// when the nvptx*-nvidia-cuda is passed to -fsycl-targets.
if (DefaultToolChain.getTriple().isNVPTX())
return false;
if (llvm::sys::path::extension(ActualFile).equals(".spv"))
if (llvm::sys::path::extension(ActualFile) == ".spv")
return false;
}
}
Expand Down
68 changes: 49 additions & 19 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,8 @@ static bool isValidSYCLTriple(llvm::Triple T) {
// SPIR/SPIRV arch, but has invalid SubArch for AOT.
StringRef A(T.getArchName());
if (T.getSubArch() == llvm::Triple::NoSubArch &&
((T.getArch() == llvm::Triple::spir && !A.equals("spir")) ||
(T.getArch() == llvm::Triple::spir64 && !A.equals("spir64"))))
((T.getArch() == llvm::Triple::spir && A != "spir") ||
(T.getArch() == llvm::Triple::spir64 && A != "spir64")))
return false;
return true;
}
Expand Down Expand Up @@ -1149,7 +1149,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
return;
const char *ArgValue = A->getValue();
for (const StringRef AllowedValue : AllowedValues)
if (AllowedValue.equals(ArgValue))
if (AllowedValue == ArgValue)
return;
Diag(clang::diag::err_drv_invalid_argument_to_option)
<< ArgValue << A->getOption().getName();
Expand Down Expand Up @@ -1182,6 +1182,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
// of -fsycl*target options passed
Arg *SYCLTargetsValues = SYCLTargets;
if (SYCLTargetsValues) {
llvm::StringSet<> SYCLTriples;
if (SYCLTargetsValues->getNumValues()) {

// Multiple targets are currently not supported when using
Expand Down Expand Up @@ -1220,15 +1221,40 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
const ToolChain *HostTC =
C.getSingleOffloadToolChain<Action::OFK_Host>();
llvm::Triple HostTriple = HostTC->getTriple();
UniqueSYCLTriplesVec.push_back(HostTriple);
SYCLTriples.insert(HostTriple.normalize());
continue;
}

if (!isValidSYCLTriple(MakeSYCLDeviceTriple(UserTargetName))) {
llvm::Triple DeviceTriple(MakeSYCLDeviceTriple(UserTargetName));
if (!isValidSYCLTriple(DeviceTriple)) {
Diag(clang::diag::err_drv_invalid_sycl_target) << Val;
continue;
}

// For any -fsycl-targets=spir64_gen additions, we will scan the
// additional -X* options for potential -device settings. These
// need to be added as a known Arch to the packager.
if (DeviceTriple.isSPIRAOT() && Arch.empty() &&
DeviceTriple.getSubArch() == llvm::Triple::SPIRSubArch_gen) {
const ToolChain *HostTC =
C.getSingleOffloadToolChain<Action::OFK_Host>();
auto DeviceTC = std::make_unique<toolchains::SYCLToolChain>(
*this, DeviceTriple, *HostTC, C.getInputArgs());
assert(DeviceTC && "Device toolchain not defined.");
ArgStringList TargetArgs;
DeviceTC->TranslateBackendTargetArgs(DeviceTC->getTriple(),
C.getInputArgs(), TargetArgs);
// Look for -device <string> and use that as the known arch to
// be associated with the current spir64_gen entry. Grab the
// right most entry.
for (int i = TargetArgs.size() - 2; i >= 0; --i) {
if (StringRef(TargetArgs[i]) == "-device") {
Arch = TargetArgs[i + 1];
break;
}
}
}

// Make sure we don't have a duplicate triple.
std::string NormalizedName = MakeSYCLDeviceTriple(Val).normalize();
auto Duplicate = FoundNormalizedTriples.find(NormalizedName);
Expand All @@ -1241,11 +1267,16 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
// Store the current triple so that we can check for duplicates in
// the following iterations.
FoundNormalizedTriples[NormalizedName] = Val;
llvm::Triple DeviceTriple(MakeSYCLDeviceTriple(UserTargetName));
UniqueSYCLTriplesVec.push_back(DeviceTriple);
SYCLTriples.insert(DeviceTriple.normalize());
if (!Arch.empty())
DerivedArchs[DeviceTriple.getTriple()].insert(Arch);
}
if (!SYCLTriples.empty()) {
for (const auto &SYCLTriple : SYCLTriples) {
llvm::Triple Triple(SYCLTriple.getKey());
UniqueSYCLTriplesVec.push_back(Triple);
}
}
addSYCLDefaultTriple(C, UniqueSYCLTriplesVec);
} else
Diag(clang::diag::warn_drv_empty_joined_argument)
Expand Down Expand Up @@ -1891,7 +1922,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// an external option setting is required to target hardware.
setOffloadCompileMode(FPGAEmulationMode);
for (StringRef ArgString : TargetArgs) {
if (ArgString.equals("-hardware") || ArgString.equals("-simulation")) {
if (ArgString == "-hardware" || ArgString == "-simulation") {
setOffloadCompileMode(FPGAHWMode);
break;
}
Expand Down Expand Up @@ -5031,17 +5062,16 @@ class OffloadingActionBuilder final {
}

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

Action *&A = std::get<0>(TargetActionInfo);
A = C.getDriver().ConstructPhaseAction(C, Args, CurPhase, A,
AssociatedOffloadKind);
++TC;
}

return ABRT_Success;
Expand Down Expand Up @@ -6250,12 +6280,12 @@ class OffloadingActionBuilder final {
using namespace tools::SYCL;
StringRef Device{Value.first};
if (Device.consume_front(gen::AmdGPU))
return TargetArch.equals(Device) && TargetTriple.isAMDGCN();
return TargetArch == Device && TargetTriple.isAMDGCN();
if (Device.consume_front(gen::NvidiaGPU))
return TargetArch.equals(Device) && TargetTriple.isNVPTX();
return TargetArch == Device && TargetTriple.isNVPTX();
if (Device.consume_front(gen::IntelGPU))
return TargetArch.equals(Device) && TargetTriple.isSPIRAOT();
return TargetArch.equals(Device) && isValidSYCLTriple(TargetTriple);
return TargetArch == Device && TargetTriple.isSPIRAOT();
return TargetArch == Device && isValidSYCLTriple(TargetTriple);
});
} else {
TargetIt = TargetTable.find(TargetTriple.str());
Expand Down Expand Up @@ -9710,7 +9740,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
const auto &ResultFiles = C.getResultFiles();
const auto CollidingFilenameIt =
llvm::find_if(ResultFiles, [NamedOutput](const auto &It) {
return StringRef(NamedOutput).equals(It.second);
return StringRef(NamedOutput) == It.second;
});
if (CollidingFilenameIt != ResultFiles.end()) {
// Upon any collision, a unique hash will be appended to the filename,
Expand Down
Loading