@@ -29,7 +29,7 @@ TEST_CASE(
29
29
#ifndef SYCL_EXT_ONEAPI_CURRENT_DEVICE
30
30
SKIP (
31
31
" The sycl_ext_oneapi_current_device extension is not supported "
32
- " by an implementation" );
32
+ " by this implementation" );
33
33
#else
34
34
if (sycl::device::get_devices ().size () < 1 ) {
35
35
SKIP (" Test requires at least one device" );
@@ -49,7 +49,7 @@ TEST_CASE(
49
49
" set_current_device function" ) {
50
50
#ifndef SYCL_EXT_ONEAPI_CURRENT_DEVICE
51
51
SKIP (
52
- " The sycl_ext_oneapi_current_device extension is not supported by an "
52
+ " The sycl_ext_oneapi_current_device extension is not supported by this "
53
53
" implementation" );
54
54
#else
55
55
for (const auto & device : sycl::device::get_devices ()) {
@@ -77,7 +77,7 @@ TEST_CASE(
77
77
#ifndef SYCL_EXT_ONEAPI_CURRENT_DEVICE
78
78
SKIP (
79
79
" The sycl_ext_oneapi_current_device extension is not supported "
80
- " by an implementation" );
80
+ " by this implementation" );
81
81
#else
82
82
const auto devices = sycl::device::get_devices ();
83
83
if (devices.size () < 2 ) {
@@ -88,10 +88,19 @@ TEST_CASE(
88
88
sycl::device t1_current_device;
89
89
sycl::device t2_current_device;
90
90
91
- std::thread t1 (thread_callback, std::cref (t1_device_to_set),
92
- std::ref (t1_current_device));
93
- std::thread t2 (thread_callback, std::cref (t2_device_to_set),
94
- std::ref (t2_current_device));
91
+ std::thread t1 ([&t1_device_to_set, &t1_current_device]() {
92
+ sycl::ext::oneapi::experimental::this_thread::set_current_device (
93
+ t1_device_to_set);
94
+ t1_current_device =
95
+ sycl::ext::oneapi::experimental::this_thread::get_current_device ();
96
+ });
97
+ std::thread t2 ([&t2_device_to_set, &t2_current_device]() {
98
+ sycl::ext::oneapi::experimental::this_thread::set_current_device (
99
+ t2_device_to_set);
100
+ t2_current_device =
101
+ sycl::ext::oneapi::experimental::this_thread::get_current_device ();
102
+ });
103
+
95
104
t1.join ();
96
105
t2.join ();
97
106
0 commit comments