Skip to content

Commit 50dba03

Browse files
committed
Fix tests and deprecate public method
1 parent f3be8a3 commit 50dba03

File tree

8 files changed

+24
-15
lines changed

8 files changed

+24
-15
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,7 @@ class __SYCL_EXPORT handler {
19091909
/// (except for the host device).
19101910
/// \param KernelFunc is a lambda that is used if device, queue is bound to,
19111911
/// is a host device.
1912+
__SYCL_DEPRECATED("This overload isn't part of SYCL2020 and will be removed.")
19121913
template <typename KernelName = detail::auto_name, typename KernelType>
19131914
void single_task(kernel Kernel, const KernelType &KernelFunc) {
19141915
// Ignore any set kernel bundles and use the one associated with the kernel

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/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/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);

0 commit comments

Comments
 (0)