Skip to content

Commit 45bdc16

Browse files
author
Alexander Johnston
committed
[SYCL] Formatting update for device_selector.cpp
Signed-off-by: Alexander Johnston <[email protected]>
1 parent 00ecbf0 commit 45bdc16

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sycl/source/device_selector.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,21 @@ int default_selector::operator()(const device &dev) const {
3434

3535
// Take note of the SYCL_BE environment variable when doing default selection
3636
const char *SYCL_BE = std::getenv("SYCL_BE");
37-
std::string backend = (SYCL_BE ? SYCL_BE : "");
38-
if (backend != "") {
37+
if (SYCL_BE) {
38+
std::string backend = (SYCL_BE ? SYCL_BE : "");
3939
// Taking the version information from the platform gives us more useful
4040
// information than the driver_version of the device.
4141
const platform Platform = dev.get_info<info::device::platform>();
42-
const std::string PlatformVersion = Platform.get_info<info::platform::version>();
42+
const std::string PlatformVersion =
43+
Platform.get_info<info::platform::version>();;
4344
// If using PI_CUDA, don't accept a non-CUDA device
44-
if (PlatformVersion.find("CUDA") == std::string::npos && backend == "PI_CUDA") {
45+
if (PlatformVersion.find("CUDA") == std::string::npos &&
46+
backend == "PI_CUDA") {
4547
return -1;
4648
}
4749
// If using PI_OPENCL, don't accept a non-OpenCL device
48-
if (PlatformVersion.find("OpenCL") == std::string::npos && backend == "PI_OPENCL") {
50+
if (PlatformVersion.find("OpenCL") == std::string::npos &&
51+
backend == "PI_OPENCL") {
4952
return -1;
5053
}
5154
}

0 commit comments

Comments
 (0)