Skip to content

Commit d85057a

Browse files
authored
Merge branch 'intel:sycl' into pablo/graph_enqueue_functions
2 parents 6a85cd3 + 0703807 commit d85057a

File tree

195 files changed

+1974
-660
lines changed

Some content is hidden

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

195 files changed

+1974
-660
lines changed

clang/lib/Driver/ToolChains/HIPUtility.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
324324
Args.MakeArgString(std::string("-output=").append(Output));
325325
BundlerArgs.push_back(BundlerOutputArg);
326326

327-
addOffloadCompressArgs(Args, BundlerArgs);
327+
// For SYCL, the compression is occurring during the wrapping step, so we do
328+
// not want to do additional compression here.
329+
if (!JA.isDeviceOffloading(Action::OFK_SYCL))
330+
addOffloadCompressArgs(Args, BundlerArgs);
328331

329332
const char *Bundler = Args.MakeArgString(
330333
T.getToolChain().GetProgramPath("clang-offload-bundler"));

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,16 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
17801780
ArgStringList TargArgs;
17811781
Args.AddAllArgValues(TargArgs, options::OPT_Xs, options::OPT_Xs_separate);
17821782
Args.AddAllArgValues(TargArgs, options::OPT_Xsycl_backend);
1783+
// For -Xsycl-target-backend=<triple> the triple value is used to push
1784+
// specific options to the matching device compilation using that triple.
1785+
// Scrutinize this to make sure we are only checking the values needed
1786+
// for the current device compilation.
1787+
for (auto *A : Args) {
1788+
if (!A->getOption().matches(options::OPT_Xsycl_backend_EQ))
1789+
continue;
1790+
if (getDriver().MakeSYCLDeviceTriple(A->getValue()) == Triple)
1791+
TargArgs.push_back(A->getValue(1));
1792+
}
17831793
// Check for any -device settings.
17841794
std::string DevArg;
17851795
if (IsJIT || Device == "pvc" || hasPVCDevice(TargArgs, DevArg)) {

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3167,7 +3167,7 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
31673167
// // code
31683168
// }
31693169
//
3170-
// [[intel::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const
3170+
// [[sycl::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const
31713171
// {
31723172
// // code
31733173
// }

clang/lib/Sema/SemaSYCLDeclAttr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ void SemaSYCL::checkDeprecatedSYCLAttributeSpelling(const ParsedAttr &A,
132132
return;
133133
}
134134

135+
// Additionally, diagnose deprecated [[intel::reqd_sub_group_size]] spelling
136+
if (A.getKind() == ParsedAttr::AT_IntelReqdSubGroupSize && A.getScopeName() &&
137+
A.getScopeName()->isStr("intel")) {
138+
diagnoseDeprecatedAttribute(A, "sycl", "reqd_sub_group_size");
139+
return;
140+
}
141+
135142
// Diagnose SYCL 2020 spellings in later SYCL modes.
136143
if (getLangOpts().getSYCLVersion() >= LangOptions::SYCL_2020) {
137144
// All attributes in the cl vendor namespace are deprecated in favor of a

clang/test/CodeGenSYCL/kernel-op-calls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Functor1 {
1111
public:
1212
Functor1(){}
1313

14-
[[intel::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const {}
14+
[[sycl::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const {}
1515

1616
[[sycl::work_group_size_hint(1, 2, 3)]] void operator()(sycl::id<2> id) const {}
1717

clang/test/CodeGenSYCL/reqd-sub-group-size.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ queue q;
77

88
class Functor16 {
99
public:
10-
[[intel::reqd_sub_group_size(16)]] void operator()() const {}
10+
[[sycl::reqd_sub_group_size(16)]] void operator()() const {}
1111
};
1212

1313
template <int SIZE>
1414
class Functor2 {
1515
public:
16-
[[intel::reqd_sub_group_size(SIZE)]] void operator()() const {}
16+
[[sycl::reqd_sub_group_size(SIZE)]] void operator()() const {}
1717
};
1818

1919
template <int N>
20-
[[intel::reqd_sub_group_size(N)]] void func() {}
20+
[[sycl::reqd_sub_group_size(N)]] void func() {}
2121

2222
int main() {
2323
q.submit([&](handler &h) {
2424
Functor16 f16;
2525
h.single_task<class kernel_name1>(f16);
2626

2727
h.single_task<class kernel_name3>(
28-
[]() [[intel::reqd_sub_group_size(4)]]{});
28+
[]() [[sycl::reqd_sub_group_size(4)]]{});
2929

3030
Functor2<2> f2;
3131
h.single_task<class kernel_name4>(f2);

clang/test/CodeGenSYCL/sycl-multi-kernel-attr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ queue q;
77

88
class Functor {
99
public:
10-
[[intel::reqd_sub_group_size(4), cl::reqd_work_group_size(32, 16, 16)]] void operator()() const {}
10+
[[sycl::reqd_sub_group_size(4), cl::reqd_work_group_size(32, 16, 16)]] void operator()() const {}
1111
};
1212

1313
class Functor1 {
1414
public:
15-
[[intel::reqd_sub_group_size(2), sycl::reqd_work_group_size(64, 32, 32)]] void operator()() const {}
15+
[[sycl::reqd_sub_group_size(2), sycl::reqd_work_group_size(64, 32, 32)]] void operator()() const {}
1616
};
1717

1818
template <int SIZE, int SIZE1, int SIZE2>

clang/test/Driver/sycl-ftarget-register-alloc-mode-old-model.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
// RUN: -fsycl-targets=spir64_gen -Xs "-device pvc" %s 2>&1 \
2121
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc
2222

23+
// RUN: %clang -### -fsycl --no-offload-new-driver \
24+
// RUN: -fsycl-targets=spir64_gen -Xsycl-target-backend "-device pvc" %s 2>&1 \
25+
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc
26+
27+
// RUN: %clang -### -fsycl --no-offload-new-driver \
28+
// RUN: -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device pvc" %s 2>&1 \
29+
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc
30+
2331
// RUN: %clang -### -fsycl --no-offload-new-driver \
2432
// RUN: -fsycl-targets=spir64_gen -Xs "-device 0x0BD5" %s 2>&1 \
2533
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc

clang/test/Driver/sycl-ftarget-register-alloc-mode.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
// RUN: -fsycl-targets=spir64_gen -Xs "-device pvc" %s 2>&1 \
2121
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc
2222

23+
// RUN: %clang -### -fsycl --offload-new-driver \
24+
// RUN: -fsycl-targets=spir64_gen -Xsycl-target-backend "-device pvc" %s 2>&1 \
25+
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc
26+
27+
// RUN: %clang -### -fsycl --offload-new-driver \
28+
// RUN: -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device pvc" %s 2>&1 \
29+
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc
30+
2331
// RUN: %clang -### -fsycl --offload-new-driver \
2432
// RUN: -fsycl-targets=spir64_gen -Xs "-device 0x0BD5" %s 2>&1 \
2533
// RUN: | FileCheck %if system-windows %{ -check-prefix=DEFAULT_AOT %} %else %{ -check-prefix=AUTO_AOT %} %s -DDEVICE=pvc

clang/test/Driver/sycl-offload-new-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
// RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \
188188
// RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" %s 2>&1 \
189189
// RUN: | FileCheck -check-prefix COMMA_FILE %s
190-
// COMMA_FILE: clang-offload-packager{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,bdw,kind=sycl"
190+
// COMMA_FILE: clang-offload-packager{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode"
191191

192192
/// Verify that --cuda-path is passed to clang-linker-wrapper for SYCL offload
193193
// RUN: %clangxx -fsycl -### -fsycl-targets=nvptx64-nvidia-cuda \

0 commit comments

Comments
 (0)