Skip to content

Commit 8d0fa98

Browse files
[SYCL] Remove SYCL_DEVICE_FILTER support (#12384)
**Overview** This PR removes support for SYCL_DEVICE_FILTER, and refactors `Basic/diagnostics/device-check.cpp` to use ONEAPI_DEVICE_FILTER instead of SYCL_DEVICE_TYPE, as the latter is depreciated.
1 parent a55e644 commit 8d0fa98

22 files changed

+120
-90
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ compiler and runtime.
88
| Environment variable | Values | Description |
99
| -------------------- | ------ | ----------- |
1010
| `ONEAPI_DEVICE_SELECTOR` | [See below.](#oneapi_device_selector) | This device selection environment variable can be used to limit the choice of devices available when the SYCL-using application is run. Useful for limiting devices to a certain type (like GPUs or accelerators) or backends (like Level Zero or OpenCL). This device selection mechanism is replacing `SYCL_DEVICE_FILTER` . The `ONEAPI_DEVICE_SELECTOR` syntax is shared with OpenMP and also allows sub-devices to be chosen. [See below.](#oneapi_device_selector) for a full description. |
11-
| `SYCL_DEVICE_FILTER` (deprecated) | `backend:device_type:device_num` | Please use `ONEAPI_DEVICE_SELECTOR` environment variable instead. See section [`SYCL_DEVICE_FILTER`](#sycl_device_filter) below for `SYCL_DEVICE_FILTER` description. |
1211
| `SYCL_DEVICE_ALLOWLIST` | See [below](#sycl_device_allowlist) | Filter out devices that do not match the pattern specified. `BackendName` accepts `host`, `opencl`, `level_zero`, `native_cpu` or `cuda`. `DeviceType` accepts `host`, `cpu`, `gpu` or `acc`. `DeviceVendorId` accepts uint32_t in hex form (`0xXYZW`). `DriverVersion`, `PlatformVersion`, `DeviceName` and `PlatformName` accept regular expression. Special characters, such as parenthesis, must be escaped. DPC++ runtime will select only those devices which satisfy provided values above and regex. More than one device can be specified using the piping symbol "\|".|
1312
| `SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING` | Any(\*) | Disables automatic rounding-up of `parallel_for` invocation ranges. |
1413
| `SYCL_CACHE_DIR` | Path | Path to persistent cache root directory. Default values are `%AppData%\libsycl_cache` for Windows and `$XDG_CACHE_HOME/libsycl_cache` on Linux, if `XDG_CACHE_HOME` is not set then `$HOME/.cache/libsycl_cache`. When none of the environment variables are set SYCL persistent cache is disabled. |
@@ -110,32 +109,6 @@ A list of devices and their driver version following the pattern:
110109
Also may contain `PlatformVersion`, `DeviceName` and `PlatformName`. There is no
111110
fixed order of properties in the pattern.
112111

113-
### `SYCL_DEVICE_FILTER`
114-
115-
This environment variable limits the SYCL RT to use only a subset of the system's devices. Setting this environment variable affects all of the device query functions (`platform::get_devices()` and `platform::get_platforms()`) and all of the device selectors.
116-
117-
The value of this environment variable is a comma separated list of filters, where each filter is a triple of the form "`backend`:`device_type`:`device_num`" (without the quotes). Each element of the triple is optional, but each filter must have at least one value. Possible values of `backend` are:
118-
- `host` (Deprecated)
119-
- `level_zero`
120-
- `opencl`
121-
- `cuda`
122-
- `hip`
123-
- `esimd_emulator` (Deprecated)
124-
- `*`
125-
126-
Possible values of `device_type` are:
127-
- `host` (Deprecated)
128-
- `cpu`
129-
- `gpu`
130-
- `acc`
131-
- `*`
132-
133-
`device_num` is an integer that indexes the enumeration of devices from the sycl-ls utility tool, where the first device in that enumeration has index zero in each backend. For example, `SYCL_DEVICE_FILTER=2` will return all devices with index '2' from all different backends. If multiple devices satisfy this device number (e.g., GPU and CPU devices can be assigned device number '2'), then default_selector will choose the device with the highest heuristic point. When `SYCL_DEVICE_ALLOWLIST` is set, it is applied before enumerating devices and affects `device_num` values.
134-
135-
Assuming a filter has all three elements of the triple, it selects only those devices that come from the given backend, have the specified device type, AND have the given device index. If more than one filter is specified, the RT is restricted to the union of devices selected by all filters.
136-
137-
Note that all device selectors will throw an exception if the filtered list of devices does not include a device that satisfies the selector. For instance, `SYCL_DEVICE_FILTER=cpu` will cause `gpu_selector()` to throw an exception. `SYCL_DEVICE_FILTER` also limits loading only specified plugins into the SYCL RT. In particular, `SYCL_DEVICE_FILTER=level_zero` will cause the `cpu_selector` to throw an exception since SYCL RT will only load the `level_zero` backend which does not support any CPU devices at this time. When multiple devices satisfy the filter (e..g, `SYCL_DEVICE_FILTER=gpu`), only one of them will be selected.
138-
139112
## `SYCL_REDUCTION_PREFERRED_WORKGROUP_SIZE`
140113

141114
This environment variable controls the preferred work-group size for reductions on specified device types. Setting this will affect all reductions without an explicitly specified work-group size on devices of types in the value of the environment variable.

sycl/doc/MultiTileCardWithLevelZero.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ by SYCL runtime. Thus in the example above there is CPU (managed by OpenCL backe
1919
GPUs corresponding to the single physical GPU (managed by either OpenCL or Level-Zero backend).
2020
There are few ways to filter observable root-devices.
2121

22-
One is using environment variable SYCL_DEVICE_FILTER described in [EnvironmentVariables.md](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md)
22+
One is using environment variable ONEAPI_DEVICE_SELECTOR described in [EnvironmentVariables.md](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md)
2323
```
24-
$ SYCL_DEVICE_FILTER=level_zero sycl-ls
24+
$ ONEAPI_DEVICE_SELECTOR=level_zero:* sycl-ls
2525
[level_zero:0] GPU : Intel(R) Level-Zero 1.1 [1.1.19792]
2626
```
2727
Another way is to use similar SYCL API described in [sycl\_ext\_oneapi\_filter\_selector](extensions/supported/sycl_ext_oneapi_filter_selector.asciidoc)
@@ -33,7 +33,7 @@ On Windows these would appear as root-devices of multiple different SYCL platfor
3333

3434
`CreateMultipleRootDevices=N NEOReadDebugKeys=1` evironment variables can be used to emulate multiple GPU cards, e.g.
3535
```
36-
$ CreateMultipleRootDevices=2 NEOReadDebugKeys=1 SYCL_DEVICE_FILTER=level_zero sycl-ls
36+
$ CreateMultipleRootDevices=2 NEOReadDebugKeys=1 ONEAPI_DEVICE_SELECTOR=level_zero:* sycl-ls
3737
[level_zero:0] GPU : Intel(R) Level-Zero 1.1 [1.1.19792]
3838
[level_zero:1] GPU : Intel(R) Level-Zero 1.1 [1.1.19792]
3939
```

sycl/doc/extensions/supported/sycl_ext_oneapi_backend_level_zero.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For further details see here: <https://github.com/intel/llvm/blob/sycl/sycl/doc/
5252
5353
There is an extension that introduces a filtering device selection to SYCL described in
5454
[sycl\_ext\_oneapi\_filter\_selector](../supported/sycl_ext_oneapi_filter_selector.asciidoc).
55-
Similar to how SYCL_DEVICE_FILTER or ONEAPI_DEVICE_SELECTOR applies filtering to the entire process this device selector can be used to
55+
Similar to how ONEAPI_DEVICE_SELECTOR applies filtering to the entire process this device selector can be used to
5656
programmatically select the Level-Zero backend.
5757
5858
When neither the environment variable nor the filtering device selector are used, the implementation chooses

sycl/doc/extensions/supported/sycl_ext_oneapi_srgb.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ And to run, be sure to select the OpenCL backend (works on both CPU and GPU devi
130130

131131
[source]
132132
----
133-
$ SYCL_DEVICE_FILTER=opencl:gpu ./myapp.bin
133+
$ ONEAPI_DEVICE_SELECTOR=opencl:gpu ./myapp.bin
134134
----
135135

136136

sycl/include/sycl/detail/device_filter.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ struct ods_target {
4646
std::optional<unsigned> SubSubDeviceNum;
4747

4848
bool IsNegativeTarget = false; // used to represent negative filters.
49+
// used in filter selector to keep count of the number of devices with
50+
// the same Backend and DeviceType.
51+
int MatchesSeen = 0;
4952

5053
ods_target(backend be) { Backend = be; };
5154
ods_target(){};
@@ -66,6 +69,7 @@ class ods_target_list {
6669
std::ostream &operator<<(std::ostream &Out, const ods_target &Target);
6770
std::vector<ods_target> Parse_ONEAPI_DEVICE_SELECTOR(const std::string &envStr);
6871

72+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
6973
// ---------------------------------------
7074
// SYCL_DEVICE_FILTER support
7175

@@ -127,6 +131,7 @@ inline std::ostream &operator<<(std::ostream &Out,
127131
}
128132
return Out;
129133
}
134+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
130135

131136
} // namespace detail
132137
} // namespace _V1

sycl/source/detail/config.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ void dumpConfig() {
161161
#undef CONFIG
162162
}
163163

164-
// Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST and
165-
// ONEAPI_DEVICE_SELECTOR
164+
// Array is used by SYCL_DEVICE_ALLOWLIST and ONEAPI_DEVICE_SELECTOR.
165+
// TODO: host device type will be removed once sycl_ext_oneapi_filter_selector
166+
// is removed.
166167
const std::array<std::pair<std::string, info::device_type>, 6> &
167168
getSyclDeviceTypeMap() {
168169
static const std::array<std::pair<std::string, info::device_type>, 6>
@@ -178,6 +179,8 @@ getSyclDeviceTypeMap() {
178179
// Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST and
179180
// ONEAPI_DEVICE_SELECTOR
180181
// TODO: Remove esimd_emulator in the next ABI breaking window.
182+
// TODO: host device type will be removed once sycl_ext_oneapi_filter_selector
183+
// is removed.
181184
const std::array<std::pair<std::string, backend>, 8> &getSyclBeMap() {
182185
static const std::array<std::pair<std::string, backend>, 8> SyclBeMap = {
183186
{{"host", backend::host},

sycl/source/detail/config.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ CONFIG(SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE, 16, __SYCL_PARALLEL_FOR_RANGE_ROU
1919
CONFIG(SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING, 16, __SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING)
2020
CONFIG(SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS, 64, __SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS)
2121
CONFIG(SYCL_DEVICELIB_NO_FALLBACK, 1, __SYCL_DEVICELIB_NO_FALLBACK)
22+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
2223
CONFIG(SYCL_DEVICE_FILTER, 1024, __SYCL_DEVICE_FILTER)
24+
#endif
2325
CONFIG(SYCL_PROGRAM_LINK_OPTIONS, 64, __SYCL_PROGRAM_LINK_OPTIONS)
2426
CONFIG(SYCL_PROGRAM_COMPILE_OPTIONS, 64, __SYCL_PROGRAM_COMPILE_OPTIONS)
2527
CONFIG(SYCL_PROGRAM_APPEND_LINK_OPTIONS, 64, __SYCL_PROGRAM_APPEND_LINK_OPTIONS)

sycl/source/detail/config.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ template <> class SYCLConfig<SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS> {
231231
}
232232
};
233233

234-
// Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST and
235-
// ONEAPI_DEVICE_SELECTOR
234+
// Array is used by SYCL_DEVICE_ALLOWLIST and ONEAPI_DEVICE_SELECTOR.
236235
const std::array<std::pair<std::string, info::device_type>, 6> &
237236
getSyclDeviceTypeMap();
238237

@@ -265,6 +264,7 @@ template <> class SYCLConfig<ONEAPI_DEVICE_SELECTOR> {
265264
}
266265
};
267266

267+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
268268
// ---------------------------------------
269269
// SYCL_DEVICE_FILTER support
270270

@@ -306,6 +306,7 @@ class __SYCL2020_DEPRECATED("Use SYCLConfig<ONEAPI_DEVICE_SELECTOR> instead")
306306
return FilterList;
307307
}
308308
};
309+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
309310

310311
template <> class SYCLConfig<SYCL_ENABLE_DEFAULT_CONTEXTS> {
311312
using BaseT = SYCLConfigBase<SYCL_ENABLE_DEFAULT_CONTEXTS>;

sycl/source/detail/device_filter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ ods_target_list::ods_target_list(const std::string &envStr) {
288288
TargetList = Parse_ONEAPI_DEVICE_SELECTOR(envStr);
289289
}
290290

291-
// Backend is compatible with the SYCL_DEVICE_FILTER in the following cases.
291+
// Backend is compatible with the ONEAPI_DEVICE_SELECTOR in the following cases.
292292
// 1. Filter backend is '*' which means ANY backend.
293293
// 2. Filter backend match exactly with the given 'Backend'
294294
bool ods_target_list::backendCompatible(backend Backend) {
@@ -300,6 +300,7 @@ bool ods_target_list::backendCompatible(backend Backend) {
300300
});
301301
}
302302

303+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
303304
// ---------------------------------------
304305
// SYCL_DEVICE_FILTER support
305306

@@ -424,6 +425,7 @@ bool device_filter_list::deviceNumberCompatible(int DeviceNum) {
424425
return (!Filter.DeviceNum) || (Filter.DeviceNum.value() == DeviceNum);
425426
});
426427
}
428+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
427429

428430
} // namespace detail
429431
} // namespace _V1

sycl/source/detail/filter_selector_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ namespace ext {
2323
namespace oneapi {
2424
namespace detail {
2525

26+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
27+
typedef struct sycl::detail::ods_target filter;
28+
#else
2629
typedef struct sycl::detail::device_filter filter;
30+
#endif
2731

2832
class filter_selector_impl {
2933
public:

sycl/source/detail/global_handler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,13 @@ std::vector<PluginPtr> &GlobalHandler::getPlugins() {
202202
enableOnCrashStackPrinting();
203203
return getOrCreate(MPlugins);
204204
}
205+
206+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
205207
device_filter_list &
206208
GlobalHandler::getDeviceFilterList(const std::string &InitValue) {
207209
return getOrCreate(MDeviceFilterList, InitValue);
208210
}
211+
#endif
209212

210213
ods_target_list &
211214
GlobalHandler::getOneapiDeviceSelectorTargets(const std::string &InitValue) {

sycl/source/detail/global_handler.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class Scheduler;
2323
class ProgramManager;
2424
class Sync;
2525
class plugin;
26+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
2627
class device_filter_list;
28+
#endif
2729
class ods_target_list;
2830
class XPTIRegistry;
2931
class ThreadPool;
@@ -70,7 +72,9 @@ class GlobalHandler {
7072
std::mutex &getPlatformMapMutex();
7173
std::mutex &getFilterMutex();
7274
std::vector<PluginPtr> &getPlugins();
75+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
7376
device_filter_list &getDeviceFilterList(const std::string &InitValue);
77+
#endif
7478
ods_target_list &getOneapiDeviceSelectorTargets(const std::string &InitValue);
7579
XPTIRegistry &getXPTIRegistry();
7680
ThreadPool &getHostTaskThreadPool();
@@ -121,7 +125,9 @@ class GlobalHandler {
121125
InstWithLock<std::mutex> MPlatformMapMutex;
122126
InstWithLock<std::mutex> MFilterMutex;
123127
InstWithLock<std::vector<PluginPtr>> MPlugins;
128+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
124129
InstWithLock<device_filter_list> MDeviceFilterList;
130+
#endif
125131
InstWithLock<ods_target_list> MOneapiDeviceSelectorTargets;
126132
InstWithLock<XPTIRegistry> MXPTIRegistry;
127133
// Thread pool for host task and event callbacks execution

sycl/source/detail/pi.cpp

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,26 +291,18 @@ std::vector<std::pair<std::string, backend>> findPlugins() {
291291
// search is done for libpi_opencl.so/pi_opencl.dll file in LD_LIBRARY_PATH
292292
// env only.
293293
//
294-
295-
device_filter_list *FilterList = SYCLConfig<SYCL_DEVICE_FILTER>::get();
296294
ods_target_list *OdsTargetList = SYCLConfig<ONEAPI_DEVICE_SELECTOR>::get();
295+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
296+
device_filter_list *FilterList = SYCLConfig<SYCL_DEVICE_FILTER>::get();
297297

298298
// Will we be filtering with SYCL_DEVICE_FILTER or ONEAPI_DEVICE_SELECTOR ?
299299
// We do NOT attempt to support both simultaneously.
300300
if (OdsTargetList && FilterList) {
301301
throw sycl::exception(sycl::make_error_code(errc::invalid),
302302
"ONEAPI_DEVICE_SELECTOR cannot be used in "
303303
"conjunction with SYCL_DEVICE_FILTER");
304-
} else if (!FilterList && !OdsTargetList) {
305-
PluginNames.emplace_back(__SYCL_OPENCL_PLUGIN_NAME, backend::opencl);
306-
PluginNames.emplace_back(__SYCL_LEVEL_ZERO_PLUGIN_NAME,
307-
backend::ext_oneapi_level_zero);
308-
PluginNames.emplace_back(__SYCL_CUDA_PLUGIN_NAME, backend::ext_oneapi_cuda);
309-
PluginNames.emplace_back(__SYCL_HIP_PLUGIN_NAME, backend::ext_oneapi_hip);
310-
PluginNames.emplace_back(__SYCL_UR_PLUGIN_NAME, backend::all);
311-
PluginNames.emplace_back(__SYCL_NATIVE_CPU_PLUGIN_NAME,
312-
backend::ext_oneapi_native_cpu);
313-
} else if (FilterList) {
304+
}
305+
if (FilterList) {
314306
std::vector<device_filter> Filters = FilterList->get();
315307
bool OpenCLFound = false;
316308
bool LevelZeroFound = false;
@@ -355,6 +347,19 @@ std::vector<std::pair<std::string, backend>> findPlugins() {
355347
}
356348
PluginNames.emplace_back(__SYCL_UR_PLUGIN_NAME, backend::all);
357349
}
350+
return PluginNames;
351+
}
352+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
353+
if (!OdsTargetList) {
354+
PluginNames.emplace_back(__SYCL_OPENCL_PLUGIN_NAME, backend::opencl);
355+
PluginNames.emplace_back(__SYCL_LEVEL_ZERO_PLUGIN_NAME,
356+
backend::ext_oneapi_level_zero);
357+
PluginNames.emplace_back(__SYCL_CUDA_PLUGIN_NAME, backend::ext_oneapi_cuda);
358+
PluginNames.emplace_back(__SYCL_HIP_PLUGIN_NAME, backend::ext_oneapi_hip);
359+
PluginNames.emplace_back(__SYCL_UR_PLUGIN_NAME, backend::all);
360+
PluginNames.emplace_back(__SYCL_NATIVE_CPU_PLUGIN_NAME,
361+
backend::ext_oneapi_native_cpu);
362+
358363
} else {
359364
ods_target_list &list = *OdsTargetList;
360365
if (list.backendCompatible(backend::opencl)) {
@@ -368,10 +373,12 @@ std::vector<std::pair<std::string, backend>> findPlugins() {
368373
PluginNames.emplace_back(__SYCL_CUDA_PLUGIN_NAME,
369374
backend::ext_oneapi_cuda);
370375
}
376+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
371377
if (list.backendCompatible(backend::ext_intel_esimd_emulator)) {
372378
PluginNames.emplace_back(__SYCL_ESIMD_EMULATOR_PLUGIN_NAME,
373379
backend::ext_intel_esimd_emulator);
374380
}
381+
#endif
375382
if (list.backendCompatible(backend::ext_oneapi_hip)) {
376383
PluginNames.emplace_back(__SYCL_HIP_PLUGIN_NAME, backend::ext_oneapi_hip);
377384
}

sycl/source/detail/platform_impl.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ std::vector<platform> platform_impl::get_platforms() {
206206
return Platforms;
207207
}
208208

209-
// Filter out the devices that are not compatible with SYCL_DEVICE_FILTER or
210-
// ONEAPI_DEVICE_SELECTOR This function matches devices in the order of backend,
211-
// device_type, and device_num. The device_filter and ods_target structs pun for
212-
// each other, as do device_filter_list and ods_target_list.
213209
// Since ONEAPI_DEVICE_SELECTOR admits negative filters, we use type traits
214210
// to distinguish the case where we are working with ONEAPI_DEVICE_SELECTOR
215211
// in the places where the functionality diverges between these two
@@ -222,9 +218,6 @@ std::vector<int> platform_impl::filterDeviceFilter(
222218
ListT *FilterList) const {
223219

224220
constexpr bool is_ods_target = std::is_same_v<FilterT, ods_target>;
225-
// There are some differences in implementation between SYCL_DEVICE_FILTER
226-
// and ONEAPI_DEVICE_SELECTOR so we use if constexpr to select the
227-
// appropriate execution path if we are dealing with the latter variable.
228221

229222
if constexpr (is_ods_target) {
230223

@@ -476,10 +469,13 @@ static std::vector<device> amendDeviceAndSubDevices(
476469
std::vector<device>
477470
platform_impl::get_devices(info::device_type DeviceType) const {
478471
std::vector<device> Res;
472+
473+
ods_target_list *OdsTargetList = SYCLConfig<ONEAPI_DEVICE_SELECTOR>::get();
474+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
479475
// Will we be filtering with SYCL_DEVICE_FILTER or ONEAPI_DEVICE_SELECTOR ?
480476
// We do NOT attempt to support both simultaneously.
481-
ods_target_list *OdsTargetList = SYCLConfig<ONEAPI_DEVICE_SELECTOR>::get();
482477
device_filter_list *FilterList = SYCLConfig<SYCL_DEVICE_FILTER>::get();
478+
#endif
483479

484480
if (is_host() && (DeviceType == info::device_type::host ||
485481
DeviceType == info::device_type::all)) {
@@ -535,21 +531,25 @@ platform_impl::get_devices(info::device_type DeviceType) const {
535531
applyAllowList(PiDevices, MPlatform, MPlugin);
536532

537533
// The first step is to filter out devices that are not compatible with
538-
// SYCL_DEVICE_FILTER or ONEAPI_DEVICE_SELECTOR. This is also the mechanism by
539-
// which top level device ids are assigned.
534+
// ONEAPI_DEVICE_SELECTOR. This is also the mechanism by which top level
535+
// device ids are assigned.
540536
std::vector<int> PlatformDeviceIndices;
541537
if (OdsTargetList) {
538+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
542539
if (FilterList) {
543540
throw sycl::exception(sycl::make_error_code(errc::invalid),
544541
"ONEAPI_DEVICE_SELECTOR cannot be used in "
545542
"conjunction with SYCL_DEVICE_FILTER");
546543
}
544+
#endif
547545
PlatformDeviceIndices = filterDeviceFilter<ods_target_list, ods_target>(
548546
PiDevices, OdsTargetList);
547+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
549548
} else if (FilterList) {
550549
PlatformDeviceIndices =
551550
filterDeviceFilter<device_filter_list, device_filter>(PiDevices,
552551
FilterList);
552+
#endif
553553
}
554554

555555
// The next step is to inflate the filtered PIDevices into SYCL Device

0 commit comments

Comments
 (0)