From f5eeccd5c08eac37fcb717d177cf10f0a4776372 Mon Sep 17 00:00:00 2001 From: "Garcia Orozco, David" Date: Wed, 18 Jun 2025 12:06:29 -0700 Subject: [PATCH 1/3] Change device selectors to never pick accelerators --- sycl/source/device_selector.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sycl/source/device_selector.cpp b/sycl/source/device_selector.cpp index 40b3f40f95eb8..647da390d09f6 100644 --- a/sycl/source/device_selector.cpp +++ b/sycl/source/device_selector.cpp @@ -186,11 +186,8 @@ __SYCL_EXPORT int default_selector_v(const device &dev) { if (dev.is_cpu()) Score += 300; - // Since we deprecate SYCL_BE and SYCL_DEVICE_TYPE, - // we should not disallow accelerator to be chosen. - // But this device type gets the lowest heuristic point. if (dev.is_accelerator()) - Score += 75; + Score = detail::REJECT_DEVICE_SCORE; // Add preference score. Score += detail::getDevicePreference(dev); @@ -221,14 +218,7 @@ __SYCL_EXPORT int cpu_selector_v(const device &dev) { } __SYCL_EXPORT int accelerator_selector_v(const device &dev) { - int Score = detail::REJECT_DEVICE_SCORE; - - traceDeviceSelector("info::device_type::accelerator"); - if (dev.is_accelerator()) { - Score = 1000; - Score += detail::getDevicePreference(dev); - } - return Score; + return detail::REJECT_DEVICE_SCORE; } __SYCL_EXPORT detail::DSelectorInvocableType From ab2c3fc8376123ba51ebeaf3221d3df29604a658 Mon Sep 17 00:00:00 2001 From: "Garcia Orozco, David" Date: Fri, 27 Jun 2025 13:29:38 -0700 Subject: [PATCH 2/3] Remove fpga/acc from ONEAPI_DEVICE_SELECTOR and SYCL_DEVICE_ALLOWLIST --- sycl/source/detail/allowlist.cpp | 8 ++++++-- sycl/source/detail/config.hpp | 5 +---- sycl/unittests/allowlist/ParseAllowList.cpp | 5 ++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sycl/source/detail/allowlist.cpp b/sycl/source/detail/allowlist.cpp index 1dbb0a7d6b889..92422f4381f6c 100644 --- a/sycl/source/detail/allowlist.cpp +++ b/sycl/source/detail/allowlist.cpp @@ -166,7 +166,7 @@ AllowListParsedT parseAllowList(const std::string &AllowListRaw) { // described in SyclBeMap ValidateEnumValues(BackendNameKeyName, getSyclBeMap()); ValidateEnumValues(DeviceTypeKeyName, - getSyclDeviceTypeMap()); + getSyclDeviceTypeMap()); if (Key == DeviceVendorIdKeyName) { // DeviceVendorId should have hex format @@ -417,13 +417,17 @@ void applyAllowList(std::vector &UrDevices, break; } for (const auto &SyclDeviceType : - getSyclDeviceTypeMap()) { + getSyclDeviceTypeMap()) { if (SyclDeviceType.second == DeviceType) { const auto &DeviceTypeValue = SyclDeviceType.first; DeviceDesc[DeviceTypeKeyName] = DeviceTypeValue; break; } } + // TEMPORARILY NEEDED WHILE FPGA IS REMOVED FROM getSyclDeviceTypeMap, but + // is still visible by the UR + if (DeviceDesc.find(DeviceTypeKeyName) == DeviceDesc.end()) + DeviceDesc[DeviceTypeKeyName] = "INVALID DEVICE"; // get DeviceVendorId value and put it to DeviceDesc uint32_t DeviceVendorIdUInt = DeviceImpl.get_info(); diff --git a/sycl/source/detail/config.hpp b/sycl/source/detail/config.hpp index d08d42a238d99..4bab68834e195 100644 --- a/sycl/source/detail/config.hpp +++ b/sycl/source/detail/config.hpp @@ -242,9 +242,6 @@ getSyclDeviceTypeMap() { {{"host", info::device_type::host}, {"cpu", info::device_type::cpu}, {"gpu", info::device_type::gpu}, - /* Duplicate entries are fine as this map is one-directional.*/ - {supportAcc ? "acc" : "fpga", info::device_type::accelerator}, - {"fpga", info::device_type::accelerator}, {"*", info::device_type::all}}}; return SyclDeviceTypeMap; } @@ -485,7 +482,7 @@ template <> class SYCLConfig { return Result; std::string ValueStr{ValueRaw}; - auto DeviceTypeMap = getSyclDeviceTypeMap(); + auto DeviceTypeMap = getSyclDeviceTypeMap(); // Iterate over all configurations. size_t Start = 0, End = 0; diff --git a/sycl/unittests/allowlist/ParseAllowList.cpp b/sycl/unittests/allowlist/ParseAllowList.cpp index d2b73d909e093..d72bec35e49d4 100644 --- a/sycl/unittests/allowlist/ParseAllowList.cpp +++ b/sycl/unittests/allowlist/ParseAllowList.cpp @@ -177,7 +177,7 @@ TEST(ParseAllowListTests, CheckAllValidBackendNameValuesAreProcessed) { TEST(ParseAllowListTests, CheckAllValidDeviceTypeValuesAreProcessed) { std::string AllowList; for (const auto &SyclDeviceType : - sycl::detail::getSyclDeviceTypeMap()) { + sycl::detail::getSyclDeviceTypeMap()) { if (!AllowList.empty()) AllowList += "|"; AllowList += "DeviceType:" + SyclDeviceType.first; @@ -186,8 +186,7 @@ TEST(ParseAllowListTests, CheckAllValidDeviceTypeValuesAreProcessed) { sycl::detail::parseAllowList(AllowList); sycl::detail::AllowListParsedT ExpectedValue{ {{"DeviceType", "host"}}, {{"DeviceType", "cpu"}}, - {{"DeviceType", "gpu"}}, {{"DeviceType", "acc"}}, - {{"DeviceType", "fpga"}}, {{"DeviceType", "*"}}}; + {{"DeviceType", "gpu"}},, {{"DeviceType", "*"}}}; EXPECT_EQ(ExpectedValue, ActualValue); } From 4f9ba07201b753fd74d3c364baf494e63797c927 Mon Sep 17 00:00:00 2001 From: "Garcia Orozco, David" Date: Fri, 4 Jul 2025 09:33:11 -0700 Subject: [PATCH 3/3] Fix warnings leading to falied compilation in precommit --- sycl/source/device_selector.cpp | 2 +- sycl/unittests/allowlist/ParseAllowList.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/source/device_selector.cpp b/sycl/source/device_selector.cpp index 647da390d09f6..705d71f778104 100644 --- a/sycl/source/device_selector.cpp +++ b/sycl/source/device_selector.cpp @@ -217,7 +217,7 @@ __SYCL_EXPORT int cpu_selector_v(const device &dev) { return Score; } -__SYCL_EXPORT int accelerator_selector_v(const device &dev) { +__SYCL_EXPORT int accelerator_selector_v(const device &) { return detail::REJECT_DEVICE_SCORE; } diff --git a/sycl/unittests/allowlist/ParseAllowList.cpp b/sycl/unittests/allowlist/ParseAllowList.cpp index d72bec35e49d4..77e24b60abd05 100644 --- a/sycl/unittests/allowlist/ParseAllowList.cpp +++ b/sycl/unittests/allowlist/ParseAllowList.cpp @@ -186,7 +186,7 @@ TEST(ParseAllowListTests, CheckAllValidDeviceTypeValuesAreProcessed) { sycl::detail::parseAllowList(AllowList); sycl::detail::AllowListParsedT ExpectedValue{ {{"DeviceType", "host"}}, {{"DeviceType", "cpu"}}, - {{"DeviceType", "gpu"}},, {{"DeviceType", "*"}}}; + {{"DeviceType", "gpu"}}, {{"DeviceType", "*"}}}; EXPECT_EQ(ExpectedValue, ActualValue); }