Skip to content

Commit f67ed98

Browse files
authored
Merge branch 'intel:sycl' into betterasserts
2 parents d44abdf + a122a28 commit f67ed98

File tree

12 files changed

+42
-22
lines changed

12 files changed

+42
-22
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ class __SYCL_EXPORT handler {
528528
bool IsKernelCreatedFromSource, bool IsESIMD);
529529
#endif
530530

531+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
531532
/// \return a string containing name of SYCL kernel.
532533
detail::ABINeutralKernelNameStrT getKernelName();
533534

@@ -543,6 +544,7 @@ class __SYCL_EXPORT handler {
543544
detail::ABINeutralKernelNameStrT KernelName = getKernelName();
544545
return KernelName == LambdaName;
545546
}
547+
#endif
546548

547549
/// Saves the location of user's code passed in \p CodeLoc for future usage in
548550
/// finalize() method.
@@ -1897,13 +1899,18 @@ class __SYCL_EXPORT handler {
18971899
Kernel);
18981900
}
18991901

1902+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
1903+
// Implementation for something that had to be removed long ago but now stuck
1904+
// until next major release...
1905+
19001906
/// Defines and invokes a SYCL kernel function.
19011907
///
19021908
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
19031909
/// (except for the host device).
19041910
/// \param KernelFunc is a lambda that is used if device, queue is bound to,
19051911
/// is a host device.
19061912
template <typename KernelName = detail::auto_name, typename KernelType>
1913+
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
19071914
void single_task(kernel Kernel, const KernelType &KernelFunc) {
19081915
// Ignore any set kernel bundles and use the one associated with the kernel
19091916
setHandlerKernelBundle(Kernel);
@@ -1931,6 +1938,7 @@ class __SYCL_EXPORT handler {
19311938
detail::CheckDeviceCopyable<KernelType>();
19321939
#endif
19331940
}
1941+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
19341942

19351943
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
19361944
/// Defines and invokes a SYCL kernel function for the specified range.

sycl/source/handler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ void handler::extractArgsAndReqs() {
10921092
if (impl->MKernelData.getDeviceKernelInfoPtr() == nullptr) {
10931093
impl->MKernelData.setDeviceKernelInfoPtr(
10941094
&detail::ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
1095-
toKernelNameStrT(getKernelName())));
1095+
detail::toKernelNameStrT(MKernel->getName())));
10961096
}
10971097
#endif
10981098
assert(impl->MKernelData.getDeviceKernelInfoPtr() != nullptr);
@@ -1108,7 +1108,7 @@ void handler::extractArgsAndReqsFromLambda(
11081108
if (impl->MKernelData.getDeviceKernelInfoPtr() == nullptr) {
11091109
impl->MKernelData.setDeviceKernelInfoPtr(
11101110
&detail::ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
1111-
toKernelNameStrT(getKernelName())));
1111+
detail::toKernelNameStrT(MKernel->getName())));
11121112
}
11131113
impl->MKernelData.setKernelInfo(LambdaPtr, NumKernelParams, ParamDescGetter,
11141114
IsESIMD, true);
@@ -1157,12 +1157,14 @@ void handler::extractArgsAndReqsFromLambda(
11571157
}
11581158
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
11591159

1160+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
11601161
// Calling methods of kernel_impl requires knowledge of class layout.
11611162
// As this is impossible in header, there's a function that calls necessary
11621163
// method inside the library and returns the result.
11631164
detail::ABINeutralKernelNameStrT handler::getKernelName() {
11641165
return MKernel->getName();
11651166
}
1167+
#endif
11661168

11671169
void handler::verifyUsedKernelBundleInternal(detail::string_view KernelName) {
11681170
detail::kernel_bundle_impl *UsedKernelBundleImplPtr =
@@ -2238,7 +2240,7 @@ sycl::detail::CGType handler::getType() const { return impl->MCGType; }
22382240

22392241
void handler::setDeviceKernelInfo(kernel &&Kernel) {
22402242
MKernel = detail::getSyclObjImpl(std::move(Kernel));
2241-
MKernelName = getKernelName();
2243+
MKernelName = MKernel->getName();
22422244
setDeviceKernelInfoPtr(&MKernel->getDeviceKernelInfo());
22432245
setType(detail::CGType::Kernel);
22442246

sycl/test-e2e/Basic/kernel_info.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
using namespace sycl;
1919
namespace syclex = sycl::ext::oneapi;
2020

21+
class SingleTask;
22+
2123
auto checkExceptionIsThrown = [](auto &getInfoFunc,
2224
const std::string &refErrMsg,
2325
std::error_code refErrc) {
@@ -40,13 +42,13 @@ int main() {
4042
queue q;
4143
auto ctx = q.get_context();
4244
buffer<int, 1> buf(range<1>(1));
43-
auto kernelID = sycl::get_kernel_id<class SingleTask>();
45+
auto kernelID = sycl::get_kernel_id<SingleTask>();
4446
auto kb = get_kernel_bundle<bundle_state::executable>(ctx, {kernelID});
4547
kernel krn = kb.get_kernel(kernelID);
4648

4749
q.submit([&](handler &cgh) {
4850
auto acc = buf.get_access<access::mode::read_write>(cgh);
49-
cgh.single_task<class SingleTask>(krn, [=]() { acc[0] = acc[0] + 1; });
51+
cgh.single_task<SingleTask>([=]() { acc[0] = acc[0] + 1; });
5052
});
5153

5254
const std::string krnName = krn.get_info<info::kernel::function_name>();

sycl/test-e2e/Basic/kernel_info_attr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@
2525
using namespace sycl;
2626
namespace syclex = sycl::ext::oneapi;
2727

28+
class SingleTask;
29+
2830
int main() {
2931
queue q;
3032
auto ctx = q.get_context();
3133
buffer<int, 1> buf(range<1>(1));
32-
auto KernelID = sycl::get_kernel_id<class SingleTask>();
34+
auto KernelID = sycl::get_kernel_id<SingleTask>();
3335
auto KB = get_kernel_bundle<bundle_state::executable>(ctx, {KernelID});
3436
kernel krn = KB.get_kernel(KernelID);
3537

3638
q.submit([&](handler &cgh) {
3739
auto acc = buf.get_access<access::mode::read_write>(cgh);
38-
cgh.single_task<class SingleTask>(krn, [=]() { acc[0] = acc[0] + 1; });
40+
cgh.single_task<SingleTask>([=]() { acc[0] = acc[0] + 1; });
3941
});
4042

4143
const std::string krnAttr = krn.get_info<info::kernel::attributes>();

sycl/test-e2e/DeviceCodeSplit/Inputs/split-per-source-second-file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void runKernelsFromFile2() {
1616

1717
Q.submit([&](sycl::handler &Cgh) {
1818
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
19-
Cgh.single_task<File2Kern1>(Krn, [=]() { Acc[0] = 3; });
19+
Cgh.single_task<File2Kern1>([=]() { Acc[0] = 3; });
2020
});
2121
}
2222
assert(Data == 3);

sycl/test-e2e/DeviceCodeSplit/split-per-kernel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main() {
2626

2727
Q.submit([&](sycl::handler &Cgh) {
2828
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
29-
Cgh.single_task<Kern1>(Krn, [=]() { Acc[0] = 1; });
29+
Cgh.single_task<Kern1>([=]() { Acc[0] = 1; });
3030
});
3131
}
3232
assert(Data == 1);
@@ -45,7 +45,7 @@ int main() {
4545

4646
Q.submit([&](sycl::handler &Cgh) {
4747
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
48-
Cgh.single_task<Kern2>(Krn, [=]() { Acc[0] = 2; });
48+
Cgh.single_task<Kern2>([=]() { Acc[0] = 2; });
4949
});
5050
}
5151
assert(Data == 2);
@@ -64,7 +64,7 @@ int main() {
6464

6565
Q.submit([&](sycl::handler &Cgh) {
6666
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
67-
Cgh.single_task<Kern3>(Krn, [=]() { Acc[0] = 3; });
67+
Cgh.single_task<Kern3>([=]() { Acc[0] = 3; });
6868
});
6969
}
7070
assert(Data == 3);

sycl/test-e2e/DeviceCodeSplit/split-per-source-main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main() {
3131
sycl::buffer<int, 1> Buf(&Data, sycl::range<1>(1));
3232
Q.submit([&](sycl::handler &Cgh) {
3333
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
34-
Cgh.single_task<File1Kern1>(Krn1, [=]() { Acc[0] = 1; });
34+
Cgh.single_task<File1Kern1>([=]() { Acc[0] = 1; });
3535
});
3636
}
3737
assert(Data == 1);
@@ -40,7 +40,7 @@ int main() {
4040
sycl::buffer<int, 1> Buf(&Data, sycl::range<1>(1));
4141
Q.submit([&](sycl::handler &Cgh) {
4242
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
43-
Cgh.single_task<File1Kern2>(Krn2, [=]() { Acc[0] = 2; });
43+
Cgh.single_task<File1Kern2>([=]() { Acc[0] = 2; });
4444
});
4545
}
4646
assert(Data == 2);

sycl/test-e2e/DeviceImageBackendContent/CUDA_interop_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
#include <sycl/detail/core.hpp>
88
#include <vector>
99

10+
class mykernel;
11+
1012
int main() {
1113
sycl::queue q;
1214
sycl::context ctxt = q.get_context();
13-
sycl::kernel_id k_id = sycl::get_kernel_id<class mykernel>();
15+
sycl::kernel_id k_id = sycl::get_kernel_id<mykernel>();
1416
auto bundle =
1517
sycl::get_kernel_bundle<sycl::bundle_state::executable>(ctxt, {k_id});
1618
assert(!bundle.empty());
1719
sycl::kernel krn = bundle.get_kernel(k_id);
1820
sycl::buffer<int> buf(sycl::range<1>(1));
1921
q.submit([&](sycl::handler &cgh) {
2022
sycl::accessor acc(buf, cgh);
21-
cgh.single_task<class mykernel>(krn, [=]() { acc[0] = 42; });
23+
cgh.single_task<mykernel>([=]() { acc[0] = 42; });
2224
});
2325
const auto img = *(bundle.begin());
2426
const auto bytes = img.ext_oneapi_get_backend_content();

sycl/test-e2e/DeviceImageBackendContent/basic_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
#include <sycl/kernel_bundle.hpp>
66
#include <type_traits>
77

8+
class mykernel;
9+
810
int main() {
911
sycl::queue q;
1012
sycl::context ctxt = q.get_context();
1113
sycl::buffer<int> buf(sycl::range<1>(1));
12-
sycl::kernel_id k_id = sycl::get_kernel_id<class mykernel>();
14+
sycl::kernel_id k_id = sycl::get_kernel_id<mykernel>();
1315
auto bundle =
1416
sycl::get_kernel_bundle<sycl::bundle_state::executable>(ctxt, {k_id});
1517
assert(!bundle.empty());
1618
sycl::kernel krn = bundle.get_kernel(k_id);
1719
q.submit([&](sycl::handler &cgh) {
1820
sycl::accessor acc(buf, cgh);
19-
cgh.single_task<class mykernel>(krn, [=]() { acc[0] = 42; });
21+
cgh.single_task<mykernel>([=]() { acc[0] = 42; });
2022
});
2123
sycl::backend backend;
2224
std::vector<std::byte> bytes;

sycl/test-e2e/NewOffloadDriver/Inputs/split-per-source-second-file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void runKernelsFromFile2() {
1616

1717
Q.submit([&](sycl::handler &Cgh) {
1818
auto Acc = Buf.get_access<sycl::access::mode::read_write>(Cgh);
19-
Cgh.single_task<File2Kern1>(Krn, [=]() { Acc[0] = 3; });
19+
Cgh.single_task<File2Kern1>([=]() { Acc[0] = 3; });
2020
});
2121
}
2222
assert(Data == 3);

0 commit comments

Comments
 (0)