Skip to content

Commit b132a74

Browse files
committed
reviewer feedback
Signed-off-by: Chris Perkins <[email protected]>
1 parent d7093a0 commit b132a74

File tree

5 files changed

+27
-17
lines changed

5 files changed

+27
-17
lines changed

sycl/doc/GetStartedGuide.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,20 @@ the CMake.
740740
741741
### Code the program for a specific GPU
742742
743-
To assist in finding a specific SYCL compatible device out of all that may be available, a "device selector" may be used. A "device selector" is a ranking function that will give an integer ranking value to all the
744-
devices on the system. It can be passed to `sycl::queue`, `sycl::device` and `sycl::platform` constructors. The highest ranking device is then selected. SYCL has built-in device selectors for selecting a generic GPU, CPU, or accelerator device, as well as one for a default device. Additionally,
745-
a user can define their own as function, lambda, or functor class. Device selectors returning negative values will "reject" a device ensuring it is not selected, but values 0 or higher will be selected by the highest score with ties resolved by an internal algorithm (see Section 4.6.1 of the SYCL 2020 specification)
746-
747-
The example below illustrates how to use a device selector to create
748-
device and queue objects bound to Intel GPU device:
743+
To assist in finding a specific SYCL compatible device out of all that may be
744+
available, a "device selector" may be used. A "device selector" is a ranking
745+
function (C++ Callable) that will give an integer ranking value to all the
746+
devices on the system. It can be passed to `sycl::queue`, `sycl::device` and
747+
`sycl::platform` constructors. The highest ranking device is then selected. SYCL
748+
has built-in device selectors for selecting a generic GPU, CPU, or accelerator
749+
device, as well as one for a default device. Additionally, a user can define
750+
their own as function, lambda, or functor class. Device selectors returning
751+
negative values will "reject" a device ensuring it is not selected, but values 0
752+
or higher will be selected by the highest score with ties resolved by an
753+
internal algorithm (see Section 4.6.1 of the SYCL 2020 specification)
754+
755+
The example below illustrates how to use a device selector to create device and
756+
queue objects bound to Intel GPU device:
749757
750758
```c++
751759
#include <sycl/sycl.hpp>

sycl/test/scheduler/ReleaseResourcesTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ int main() {
2020

2121
// Checks creating of the second host accessor while first one is alive.
2222
try {
23+
sycl::default_selector device_selector;
24+
2325
sycl::range<1> BufSize{1};
2426
sycl::buffer<int, 1> Buf(BufSize);
2527

26-
TestQueue Queue(sycl::default_selector{});
28+
TestQueue Queue(device_selector);
2729

2830
Queue.submit([&](sycl::handler &CGH) {
2931
auto BufAcc = Buf.get_access<sycl_access_mode::read_write>(CGH);

sycl/test/warnings/sycl_2020_deprecations.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ int main() {
195195
group.get_linear_id();
196196

197197
// expected-warning@+1{{'default_selector' is deprecated: Use the callable sycl::default_selector_v instead.}}
198-
sycl::default_selector ds{};
198+
sycl::default_selector ds;
199199
// expected-warning@+1{{'cpu_selector' is deprecated: Use the callable sycl::cpu_selector_v instead.}}
200-
sycl::cpu_selector cs{};
200+
sycl::cpu_selector cs;
201201
// expected-warning@+1{{'gpu_selector' is deprecated: Use the callable sycl::gpu_selector_v instead.}}
202-
sycl::gpu_selector gs{};
202+
sycl::gpu_selector gs;
203203
// expected-warning@+1{{'accelerator_selector' is deprecated: Use the callable sycl::accelerator_selector_v instead.}}
204-
sycl::accelerator_selector as{};
204+
sycl::accelerator_selector as;
205205
// expected-warning@+1{{'host_selector' is deprecated: Use a callable function instead.}}
206-
sycl::host_selector hs{};
206+
sycl::host_selector hs;
207207

208208
// expected-warning@+2{{'local' is deprecated: use `local_accessor` instead}}
209209
Queue.submit([&](sycl::handler &CGH) {

sycl/unittests/assert/assert.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ void ChildProcess(int StdErrFD) {
438438
exit(1);
439439
}
440440

441-
sycl::platform Plt{sycl::default_selector_v};
441+
sycl::platform Plt;
442442

443443
sycl::unittest::PiMock Mock{Plt};
444444

@@ -516,7 +516,7 @@ void ParentProcess(int ChildPID, int ChildStdErrFD) {
516516
TEST(Assert, TestPositive) {
517517
// Preliminary checks
518518
{
519-
sycl::platform Plt{sycl::default_selector_v};
519+
sycl::platform Plt;
520520
if (Plt.is_host()) {
521521
printf("Test is not supported on host, skipping\n");
522522
return;
@@ -572,7 +572,7 @@ TEST(Assert, TestAssertServiceKernelHidden) {
572572
}
573573

574574
TEST(Assert, TestInteropKernelNegative) {
575-
sycl::platform Plt{sycl::default_selector_v};
575+
sycl::platform Plt;
576576

577577
if (Plt.is_host()) {
578578
printf("Test is not supported on host, skipping\n");
@@ -610,7 +610,7 @@ TEST(Assert, TestInteropKernelNegative) {
610610
}
611611

612612
TEST(Assert, TestInteropKernelFromProgramNegative) {
613-
sycl::platform Plt{sycl::default_selector_v};
613+
sycl::platform Plt;
614614

615615
if (Plt.is_host()) {
616616
printf("Test is not supported on host, skipping\n");

sycl/unittests/buffer/BufferLocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static pi_result redefinedDeviceGetInfo(pi_device device,
7171

7272
class BufferTest : public ::testing::Test {
7373
public:
74-
BufferTest() : Plt{sycl::default_selector_v} {}
74+
BufferTest() {}
7575

7676
protected:
7777
void SetUp() override {

0 commit comments

Comments
 (0)