Skip to content

Commit 1bc3033

Browse files
authored
Merge branch 'sycl' into p2p-fix-query
2 parents 222ac44 + 7116e9d commit 1bc3033

File tree

242 files changed

+2535
-961
lines changed

Some content is hidden

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

242 files changed

+2535
-961
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ jobs:
212212
if: always() && !cancelled() && contains(inputs.changes, 'libdevice')
213213
run: |
214214
cmake --build $GITHUB_WORKSPACE/build --target check-libdevice
215+
- name: Check E2E test requirements
216+
if: always() && !cancelled() && !contains(inputs.changes, 'sycl')
217+
run: |
218+
# TODO consider moving this to Dockerfile.
219+
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
220+
LIT_OPTS="--allow-empty-runs" LIT_FILTER="e2e_test_requirements" cmake --build $GITHUB_WORKSPACE/build --target check-sycl
215221
- name: Install
216222
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
217223
# TODO replace utility installation with a single CMake target

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5590,7 +5590,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
55905590
// only be used for SPIR/SPIR-V based targets.
55915591
if (Triple.isSPIROrSPIRV())
55925592
if (Args.hasFlag(options::OPT_fsycl_instrument_device_code,
5593-
options::OPT_fno_sycl_instrument_device_code, true))
5593+
options::OPT_fno_sycl_instrument_device_code, false))
55945594
CmdArgs.push_back("-fsycl-instrument-device-code");
55955595

55965596
if (!SYCLStdArg) {

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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
508508
}
509509

510510
if (Args.hasFlag(options::OPT_fsycl_instrument_device_code,
511-
options::OPT_fno_sycl_instrument_device_code, true))
511+
options::OPT_fno_sycl_instrument_device_code, false))
512512
addLibraries(SYCLDeviceAnnotationLibs);
513513

514514
#if !defined(_WIN32)
@@ -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/linker-wrapper-sycl-win.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,7 @@
112112
// CHK-CMDS-AOT-AMD-NEXT: offload-wrapper: input: [[BUNDLEROUT]], output: [[WRAPPEROUT:.*]].bc
113113
// CHK-CMDS-AOT-AMD-NEXT: "{{.*}}clang.exe"{{.*}} -c -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
114114
// CHK-CMDS-AOT-AMD-NEXT: "{{.*}}ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}.o
115+
116+
// Error handling when --linker-path is not provided for clang-linker-wrapper
117+
// RUN: not clang-linker-wrapper 2>&1 | FileCheck --check-prefix=LINKER-PATH-NOT-PROVIDED %s
118+
// LINKER-PATH-NOT-PROVIDED: linker path missing, must pass 'linker-path'

0 commit comments

Comments
 (0)