From e8c6352e404bfd264364dfceb64bce718d7e27f9 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Thu, 28 Mar 2024 10:13:36 -0700 Subject: [PATCH] [ABI-Break][SYCL] Drop SYCL_DEVICE_FILTER support Has been deprecated for some time with a planned removal during the ABI breaking window. --- sycl/include/sycl/detail/device_filter.hpp | 64 -------- sycl/source/detail/config.def | 3 - sycl/source/detail/config.hpp | 44 ------ sycl/source/detail/device_filter.cpp | 142 +----------------- sycl/source/detail/filter_selector_impl.hpp | 6 +- sycl/source/detail/global_handler.cpp | 7 - sycl/source/detail/global_handler.hpp | 9 -- sycl/source/detail/pi.cpp | 58 ------- sycl/source/detail/platform_impl.cpp | 18 --- sycl/source/device.cpp | 8 - .../deprecated_sycl_device_filter.cpp | 29 ---- .../DeprecatedFeatures/sycl_device_filter.cpp | 35 ----- sycl/tools/sycl-ls/sycl-ls.cpp | 17 --- 13 files changed, 3 insertions(+), 437 deletions(-) delete mode 100644 sycl/test-e2e/DeprecatedFeatures/deprecated_sycl_device_filter.cpp delete mode 100644 sycl/test-e2e/DeprecatedFeatures/sycl_device_filter.cpp diff --git a/sycl/include/sycl/detail/device_filter.hpp b/sycl/include/sycl/detail/device_filter.hpp index f8832f11e3a11..f5aec21290009 100644 --- a/sycl/include/sycl/detail/device_filter.hpp +++ b/sycl/include/sycl/detail/device_filter.hpp @@ -69,70 +69,6 @@ class ods_target_list { std::ostream &operator<<(std::ostream &Out, const ods_target &Target); std::vector Parse_ONEAPI_DEVICE_SELECTOR(const std::string &envStr); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -// --------------------------------------- -// SYCL_DEVICE_FILTER support - -struct device_filter { - std::optional Backend; - std::optional DeviceType; - std::optional DeviceNum; - int MatchesSeen = 0; - - device_filter(){}; - device_filter(const std::string &FilterString); - friend std::ostream &operator<<(std::ostream &Out, - const device_filter &Filter); -}; - -class device_filter_list { - std::vector FilterList; - -public: - device_filter_list() {} - device_filter_list(const std::string &FilterString); - device_filter_list(device_filter &Filter); - void addFilter(device_filter &Filter); - std::vector &get() { return FilterList; } - bool backendCompatible(backend Backend); - bool deviceTypeCompatible(info::device_type DeviceType); - bool deviceNumberCompatible(int DeviceNum); - friend std::ostream &operator<<(std::ostream &Out, - const device_filter_list &List); -}; - -inline std::ostream &operator<<(std::ostream &Out, - const device_filter &Filter) { - Out << Filter.Backend << ":"; - if (Filter.DeviceType == info::device_type::host) { - Out << "host"; - } else if (Filter.DeviceType == info::device_type::cpu) { - Out << "cpu"; - } else if (Filter.DeviceType == info::device_type::gpu) { - Out << "gpu"; - } else if (Filter.DeviceType == info::device_type::accelerator) { - Out << "accelerator"; - } else if (Filter.DeviceType == info::device_type::all) { - Out << "*"; - } else { - Out << "unknown"; - } - if (Filter.DeviceNum) { - Out << ":" << Filter.DeviceNum.value(); - } - return Out; -} - -inline std::ostream &operator<<(std::ostream &Out, - const device_filter_list &List) { - for (const device_filter &Filter : List.FilterList) { - Out << Filter; - Out << ","; - } - return Out; -} -#endif // __INTEL_PREVIEW_BREAKING_CHANGES - } // namespace detail } // namespace _V1 } // namespace sycl diff --git a/sycl/source/detail/config.def b/sycl/source/detail/config.def index 6062e59ad0490..04744c5c6841a 100644 --- a/sycl/source/detail/config.def +++ b/sycl/source/detail/config.def @@ -19,9 +19,6 @@ CONFIG(SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE, 16, __SYCL_PARALLEL_FOR_RANGE_ROU CONFIG(SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING, 16, __SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING) CONFIG(SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS, 64, __SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS) CONFIG(SYCL_DEVICELIB_NO_FALLBACK, 1, __SYCL_DEVICELIB_NO_FALLBACK) -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -CONFIG(SYCL_DEVICE_FILTER, 1024, __SYCL_DEVICE_FILTER) -#endif CONFIG(SYCL_PROGRAM_LINK_OPTIONS, 64, __SYCL_PROGRAM_LINK_OPTIONS) CONFIG(SYCL_PROGRAM_COMPILE_OPTIONS, 64, __SYCL_PROGRAM_COMPILE_OPTIONS) CONFIG(SYCL_PROGRAM_APPEND_LINK_OPTIONS, 64, __SYCL_PROGRAM_APPEND_LINK_OPTIONS) diff --git a/sycl/source/detail/config.hpp b/sycl/source/detail/config.hpp index 633a8227873ad..efbdc81fb34fb 100644 --- a/sycl/source/detail/config.hpp +++ b/sycl/source/detail/config.hpp @@ -285,50 +285,6 @@ template <> class SYCLConfig { } }; -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -// --------------------------------------- -// SYCL_DEVICE_FILTER support - -template <> -class __SYCL2020_DEPRECATED("Use SYCLConfig instead") - SYCLConfig { - using BaseT = SYCLConfigBase; - -public: - static device_filter_list *get() { - static bool Initialized = false; - static device_filter_list *FilterList = nullptr; - - // Configuration parameters are processed only once, like reading a string - // from environment and converting it into a typed object. - if (Initialized) { - return FilterList; - } - - const char *ValStr = BaseT::getRawValue(); - if (ValStr) { - - std::cerr - << "\nWARNING: The enviroment variable SYCL_DEVICE_FILTER" - " is deprecated. Please use ONEAPI_DEVICE_SELECTOR instead.\n" - "For more details, please refer to:\n" - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md#oneapi_device_selector\n\n"; - - FilterList = &GlobalHandler::instance().getDeviceFilterList(ValStr); - } - - // As mentioned above, configuration parameters are processed only once. - // If multiple threads are checking this env var at the same time, - // they will end up setting the configration to the same value. - // If other threads check after one thread already set configration, - // the threads will get the same value as the first thread. - Initialized = true; - return FilterList; - } -}; -#endif // __INTEL_PREVIEW_BREAKING_CHANGES - template <> class SYCLConfig { using BaseT = SYCLConfigBase; diff --git a/sycl/source/detail/device_filter.cpp b/sycl/source/detail/device_filter.cpp index 11072eae9e610..2df1bc39e8585 100644 --- a/sycl/source/detail/device_filter.cpp +++ b/sycl/source/detail/device_filter.cpp @@ -93,12 +93,7 @@ static void Parse_ODS_Device(ods_target &Target, std::string_view TopDeviceStr = DeviceSubTuple[0]; // Handle explicit device type (e.g. 'gpu'). - auto DeviceTypeMap = getSyclDeviceTypeMap< -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - true /*Enable 'acc'*/ -#endif - >(); // <-- std::array> + auto DeviceTypeMap = getSyclDeviceTypeMap(); auto It = std::find_if(std::begin(DeviceTypeMap), std::end(DeviceTypeMap), @@ -266,11 +261,7 @@ Parse_ONEAPI_DEVICE_SELECTOR(const std::string &envString) { std::ostream &operator<<(std::ostream &Out, const ods_target &Target) { Out << Target.Backend; if (Target.DeviceType) { - auto DeviceTypeMap = getSyclDeviceTypeMap< -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - true /*Enable 'acc'*/ -#endif - >(); + auto DeviceTypeMap = getSyclDeviceTypeMap(); auto Match = std::find_if( DeviceTypeMap.begin(), DeviceTypeMap.end(), [&](auto Pair) { return (Pair.second == Target.DeviceType); }); @@ -307,135 +298,6 @@ bool ods_target_list::backendCompatible(backend Backend) { return (TargetBackend == Backend) || (TargetBackend == backend::all); }); } - -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -// --------------------------------------- -// SYCL_DEVICE_FILTER support - -device_filter::device_filter(const std::string &FilterString) { - std::vector Tokens = tokenize(FilterString, ":"); - size_t TripleValueID = 0; - - auto FindElement = [&](auto Element) { - return std::string::npos != Tokens[TripleValueID].find(Element.first); - }; - - // Handle the optional 1st field of the filter, backend - // Check if the first entry matches with a known backend type - auto It = std::find_if(std::begin(getSyclBeMap()), std::end(getSyclBeMap()), - FindElement); - // If no match is found, set the backend type backend::all - // which actually means 'any backend' will be a match. - if (It == getSyclBeMap().end()) - Backend = backend::all; - else { - Backend = It->second; - TripleValueID++; - - if (Backend == backend::host) - std::cerr << "WARNING: The 'host' backend type is no longer supported in " - "device filter." - << std::endl; - } - - // Handle the optional 2nd field of the filter - device type. - // Check if the 2nd entry matches with any known device type. - if (TripleValueID >= Tokens.size()) { - DeviceType = info::device_type::all; - } else { - auto Iter = std::find_if( - std::begin(getSyclDeviceTypeMap()), - std::end(getSyclDeviceTypeMap()), FindElement); - // If no match is found, set device_type 'all', - // which actually means 'any device_type' will be a match. - if (Iter == getSyclDeviceTypeMap().end()) - DeviceType = info::device_type::all; - else { - DeviceType = Iter->second; - TripleValueID++; - - if (DeviceType == info::device_type::host) - std::cerr << "WARNING: The 'host' device type is no longer supported " - "in device filter." - << std::endl; - } - } - - // Handle the optional 3rd field of the filter, device number - // Try to convert the remaining string to an integer. - // If succeessful, the converted integer is the desired device num. - if (TripleValueID < Tokens.size()) { - try { - DeviceNum = std::stoi(Tokens[TripleValueID].data()); - } catch (...) { - std::string Message = - std::string("Invalid device filter: ") + FilterString + - "\nPossible backend values are " - "{opencl,level_zero,cuda,hip,*}.\n" - "Possible device types are {cpu,gpu,acc,*}.\n" - "Device number should be an non-negative integer.\n"; - throw sycl::invalid_parameter_error(Message, PI_ERROR_INVALID_VALUE); - } - } -} - -device_filter_list::device_filter_list(const std::string &FilterStr) { - // First, change the string in all lowercase. - // This means we allow the user to use both uppercase and lowercase strings. - std::string FilterString = FilterStr; - std::transform(FilterString.begin(), FilterString.end(), FilterString.begin(), - ::tolower); - // SYCL_DEVICE_FILTER can set multiple filters separated by commas. - // convert each filter triple string into an istance of device_filter class. - size_t Pos = 0; - while (Pos < FilterString.size()) { - size_t CommaPos = FilterString.find(",", Pos); - if (CommaPos == std::string::npos) { - CommaPos = FilterString.size(); - } - std::string SubString = FilterString.substr(Pos, CommaPos - Pos); - FilterList.push_back(device_filter(SubString)); - Pos = CommaPos + 1; - } -} - -device_filter_list::device_filter_list(device_filter &Filter) { - FilterList.push_back(Filter); -} - -void device_filter_list::addFilter(device_filter &Filter) { - FilterList.push_back(Filter); -} - -// Backend is compatible with the SYCL_DEVICE_FILTER in the following cases. -// 1. Filter backend is '*' which means ANY backend. -// 2. Filter backend match exactly with the given 'Backend' -bool device_filter_list::backendCompatible(backend Backend) { - return std::any_of( - FilterList.begin(), FilterList.end(), [&](device_filter &Filter) { - backend FilterBackend = Filter.Backend.value_or(backend::all); - return (FilterBackend == Backend) || (FilterBackend == backend::all); - }); -} - -bool device_filter_list::deviceTypeCompatible(info::device_type DeviceType) { - return std::any_of(FilterList.begin(), FilterList.end(), - [&](device_filter &Filter) { - info::device_type FilterDevType = - Filter.DeviceType.value_or(info::device_type::all); - return (FilterDevType == DeviceType) || - (FilterDevType == info::device_type::all); - }); -} - -bool device_filter_list::deviceNumberCompatible(int DeviceNum) { - return std::any_of( - FilterList.begin(), FilterList.end(), [&](device_filter &Filter) { - return (!Filter.DeviceNum) || (Filter.DeviceNum.value() == DeviceNum); - }); -} -#endif // __INTEL_PREVIEW_BREAKING_CHANGES - } // namespace detail } // namespace _V1 } // namespace sycl diff --git a/sycl/source/detail/filter_selector_impl.hpp b/sycl/source/detail/filter_selector_impl.hpp index a5da10f912ab3..59070ebdb0f10 100644 --- a/sycl/source/detail/filter_selector_impl.hpp +++ b/sycl/source/detail/filter_selector_impl.hpp @@ -23,11 +23,7 @@ namespace ext { namespace oneapi { namespace detail { -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES -typedef struct sycl::detail::ods_target filter; -#else -typedef struct sycl::detail::device_filter filter; -#endif +using filter = sycl::detail::ods_target; class filter_selector_impl { public: diff --git a/sycl/source/detail/global_handler.cpp b/sycl/source/detail/global_handler.cpp index d57b6e5a50354..bfdee9e7f72c5 100644 --- a/sycl/source/detail/global_handler.cpp +++ b/sycl/source/detail/global_handler.cpp @@ -203,13 +203,6 @@ std::vector &GlobalHandler::getPlugins() { return getOrCreate(MPlugins); } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -device_filter_list & -GlobalHandler::getDeviceFilterList(const std::string &InitValue) { - return getOrCreate(MDeviceFilterList, InitValue); -} -#endif - ods_target_list & GlobalHandler::getOneapiDeviceSelectorTargets(const std::string &InitValue) { return getOrCreate(MOneapiDeviceSelectorTargets, InitValue); diff --git a/sycl/source/detail/global_handler.hpp b/sycl/source/detail/global_handler.hpp index be19141335bda..605be19fb7ab6 100644 --- a/sycl/source/detail/global_handler.hpp +++ b/sycl/source/detail/global_handler.hpp @@ -23,9 +23,6 @@ class Scheduler; class ProgramManager; class Sync; class plugin; -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -class device_filter_list; -#endif class ods_target_list; class XPTIRegistry; class ThreadPool; @@ -72,9 +69,6 @@ class GlobalHandler { std::mutex &getPlatformMapMutex(); std::mutex &getFilterMutex(); std::vector &getPlugins(); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - device_filter_list &getDeviceFilterList(const std::string &InitValue); -#endif ods_target_list &getOneapiDeviceSelectorTargets(const std::string &InitValue); XPTIRegistry &getXPTIRegistry(); ThreadPool &getHostTaskThreadPool(); @@ -125,9 +119,6 @@ class GlobalHandler { InstWithLock MPlatformMapMutex; InstWithLock MFilterMutex; InstWithLock> MPlugins; -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - InstWithLock MDeviceFilterList; -#endif InstWithLock MOneapiDeviceSelectorTargets; InstWithLock MXPTIRegistry; // Thread pool for host task and event callbacks execution diff --git a/sycl/source/detail/pi.cpp b/sycl/source/detail/pi.cpp index bbee0c1131feb..fd1ba3ef79f0a 100644 --- a/sycl/source/detail/pi.cpp +++ b/sycl/source/detail/pi.cpp @@ -292,64 +292,6 @@ std::vector> findPlugins() { // env only. // ods_target_list *OdsTargetList = SYCLConfig::get(); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - device_filter_list *FilterList = SYCLConfig::get(); - - // Will we be filtering with SYCL_DEVICE_FILTER or ONEAPI_DEVICE_SELECTOR ? - // We do NOT attempt to support both simultaneously. - if (OdsTargetList && FilterList) { - throw sycl::exception(sycl::make_error_code(errc::invalid), - "ONEAPI_DEVICE_SELECTOR cannot be used in " - "conjunction with SYCL_DEVICE_FILTER"); - } - if (FilterList) { - std::vector Filters = FilterList->get(); - bool OpenCLFound = false; - bool LevelZeroFound = false; - bool CudaFound = false; - bool EsimdCpuFound = false; - bool HIPFound = false; - bool NativeCPUFound = false; - for (const device_filter &Filter : Filters) { - backend Backend = Filter.Backend ? Filter.Backend.value() : backend::all; - if (!OpenCLFound && - (Backend == backend::opencl || Backend == backend::all)) { - PluginNames.emplace_back(__SYCL_OPENCL_PLUGIN_NAME, backend::opencl); - OpenCLFound = true; - } - if (!LevelZeroFound && (Backend == backend::ext_oneapi_level_zero || - Backend == backend::all)) { - PluginNames.emplace_back(__SYCL_LEVEL_ZERO_PLUGIN_NAME, - backend::ext_oneapi_level_zero); - LevelZeroFound = true; - } - if (!CudaFound && - (Backend == backend::ext_oneapi_cuda || Backend == backend::all)) { - PluginNames.emplace_back(__SYCL_CUDA_PLUGIN_NAME, - backend::ext_oneapi_cuda); - CudaFound = true; - } - if (!EsimdCpuFound && Backend == backend::ext_intel_esimd_emulator) { - PluginNames.emplace_back(__SYCL_ESIMD_EMULATOR_PLUGIN_NAME, - backend::ext_intel_esimd_emulator); - EsimdCpuFound = true; - } - if (!HIPFound && - (Backend == backend::ext_oneapi_hip || Backend == backend::all)) { - PluginNames.emplace_back(__SYCL_HIP_PLUGIN_NAME, - backend::ext_oneapi_hip); - HIPFound = true; - } - if (!NativeCPUFound && (Backend == backend::ext_oneapi_native_cpu || - Backend == backend::all)) { - PluginNames.emplace_back(__SYCL_NATIVE_CPU_PLUGIN_NAME, - backend::ext_oneapi_native_cpu); - } - PluginNames.emplace_back(__SYCL_UR_PLUGIN_NAME, backend::all); - } - return PluginNames; - } -#endif // __INTEL_PREVIEW_BREAKING_CHANGES if (!OdsTargetList) { PluginNames.emplace_back(__SYCL_OPENCL_PLUGIN_NAME, backend::opencl); PluginNames.emplace_back(__SYCL_LEVEL_ZERO_PLUGIN_NAME, diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index eb28ffaf3819a..c13931aafb239 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -471,11 +471,6 @@ platform_impl::get_devices(info::device_type DeviceType) const { std::vector Res; ods_target_list *OdsTargetList = SYCLConfig::get(); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - // Will we be filtering with SYCL_DEVICE_FILTER or ONEAPI_DEVICE_SELECTOR ? - // We do NOT attempt to support both simultaneously. - device_filter_list *FilterList = SYCLConfig::get(); -#endif if (is_host() && (DeviceType == info::device_type::host || DeviceType == info::device_type::all)) { @@ -535,21 +530,8 @@ platform_impl::get_devices(info::device_type DeviceType) const { // device ids are assigned. std::vector PlatformDeviceIndices; if (OdsTargetList) { -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - if (FilterList) { - throw sycl::exception(sycl::make_error_code(errc::invalid), - "ONEAPI_DEVICE_SELECTOR cannot be used in " - "conjunction with SYCL_DEVICE_FILTER"); - } -#endif PlatformDeviceIndices = filterDeviceFilter( PiDevices, OdsTargetList); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - } else if (FilterList) { - PlatformDeviceIndices = - filterDeviceFilter(PiDevices, - FilterList); -#endif } // The next step is to inflate the filtered PIDevices into SYCL Device diff --git a/sycl/source/device.cpp b/sycl/source/device.cpp index 4d9737ca0412a..5afed50306994 100644 --- a/sycl/source/device.cpp +++ b/sycl/source/device.cpp @@ -50,10 +50,6 @@ device::device(const device_selector &deviceSelector) { std::vector device::get_devices(info::device_type deviceType) { std::vector devices; -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - detail::device_filter_list *FilterList = - detail::SYCLConfig::get(); -#endif detail::ods_target_list *OdsTargetList = detail::SYCLConfig::get(); @@ -61,10 +57,6 @@ std::vector device::get_devices(info::device_type deviceType) { for (const auto &plt : thePlatforms) { backend platformBackend = plt.get_backend(); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - if (FilterList && !FilterList->backendCompatible(platformBackend)) - continue; -#endif if (OdsTargetList && !OdsTargetList->backendCompatible(platformBackend)) continue; diff --git a/sycl/test-e2e/DeprecatedFeatures/deprecated_sycl_device_filter.cpp b/sycl/test-e2e/DeprecatedFeatures/deprecated_sycl_device_filter.cpp deleted file mode 100644 index 12fa070e86507..0000000000000 --- a/sycl/test-e2e/DeprecatedFeatures/deprecated_sycl_device_filter.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// RUN: %{build} -o %t.out -// RUN: env SYCL_DEVICE_FILTER='*' %{run-unfiltered-devices} %t.out &> %t.log -// RUN: FileCheck %s < %t.log -// -// CHECK: WARNING: The enviroment variable SYCL_DEVICE_FILTER is deprecated. -// CHECK-SAME: Please use ONEAPI_DEVICE_SELECTOR instead. -// CHECK-NEXT: For more details, please refer to: -// CHECK-NEXT: https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector - -//==---- deprecated_sycl_device_filter.cpp - SYCL 2020 deprecation test ----==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------------------------------===// - -// This test is to check if a warning message is displayed when using the -// enviroment variable SYCL_DEVICE_FILTER -// TODO: Remove test when SYCL_DEVICE_FILTER is removed -#include - -int main() { - using namespace sycl; - platform p{}; - auto devices = p.get_devices(); - std::cout << "Passed test\n"; - return 0; -} diff --git a/sycl/test-e2e/DeprecatedFeatures/sycl_device_filter.cpp b/sycl/test-e2e/DeprecatedFeatures/sycl_device_filter.cpp deleted file mode 100644 index d717030d368d9..0000000000000 --- a/sycl/test-e2e/DeprecatedFeatures/sycl_device_filter.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// RUN: %{build} -o %t.out -// RUN: %if any-device-is-cpu %{ env SYCL_DEVICE_FILTER=cpu %{run-unfiltered-devices} %t.out %} -// RUN: %if any-device-is-gpu %{ env SYCL_DEVICE_FILTER=gpu %{run-unfiltered-devices} %t.out %} -// RUN: %if any-device-is-acc %{ env SYCL_DEVICE_FILTER=acc %{run-unfiltered-devices} %t.out %} -// TODO: Remove this test once SYCL_DEVICE_FILTER is removed. - -#include - -int main() { - namespace dev_info = sycl::info::device; - - auto device_type = [](sycl::device d) -> std::string_view { - switch (d.get_info()) { - case sycl::info::device_type::cpu: - return "cpu"; - case sycl::info::device_type::gpu: - return "gpu"; - case sycl::info::device_type::accelerator: - return "acc"; - default: - return "unknown"; - } - }; - - auto devices = sycl::device::get_devices(); - for (sycl::device d : devices) { - std::cout << device_type(d) << " " << d.get_info() - << std::endl; - } - assert(!devices.empty()); - auto expected_type = std::getenv("SYCL_DEVICE_FILTER"); - assert(std::all_of(devices.begin(), devices.end(), - [=](auto d) { return expected_type == device_type(d); })); - return 0; -} diff --git a/sycl/tools/sycl-ls/sycl-ls.cpp b/sycl/tools/sycl-ls/sycl-ls.cpp index 5002a1926523d..a59b33c1de65d 100644 --- a/sycl/tools/sycl-ls/sycl-ls.cpp +++ b/sycl/tools/sycl-ls/sycl-ls.cpp @@ -141,23 +141,6 @@ static int printUsageAndExit() { // the filter environment variable is set. static void printWarningIfFiltersUsed(bool &SuppressNumberPrinting) { -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - const char *filter = std::getenv("SYCL_DEVICE_FILTER"); - if (filter) { - if (!DiscardFilters) { - std::cerr << "INFO: Output filtered by SYCL_DEVICE_FILTER " - << "environment variable, which is set to " << filter << "." - << std::endl; - std::cerr - << "To see device ids, use the --ignore-device-selectors CLI option." - << std::endl - << std::endl; - SuppressNumberPrinting = true; - } else - FilterEnvVars.push_back("SYCL_DEVICE_FILTER"); - } -#endif - const char *ods_targets = std::getenv("ONEAPI_DEVICE_SELECTOR"); if (ods_targets) { if (!DiscardFilters) {