File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -34,18 +34,21 @@ int default_selector::operator()(const device &dev) const {
34
34
35
35
// Take note of the SYCL_BE environment variable when doing default selection
36
36
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 : " " );
39
39
// Taking the version information from the platform gives us more useful
40
40
// information than the driver_version of the device.
41
41
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>();;
43
44
// 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" ) {
45
47
return -1 ;
46
48
}
47
49
// 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" ) {
49
52
return -1 ;
50
53
}
51
54
}
You can’t perform that action at this time.
0 commit comments