diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index ac0274c0bd4c7..10fd2d0fc9aa2 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -65,7 +65,7 @@ struct DevDescT { int platformVerSize = 0; }; -static std::vector getWhiteListDesc() { +static std::vector getAllowListDesc() { const char *str = SYCLConfig::get(); if (!str) return {}; @@ -101,15 +101,13 @@ static std::vector getWhiteListDesc() { } if (':' != *str) - throw sycl::runtime_error("Malformed device white list", - PI_INVALID_VALUE); + throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE); // Skip ':' str += 1; if ('{' != *str || '{' != *(str + 1)) - throw sycl::runtime_error("Malformed device white list", - PI_INVALID_VALUE); + throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE); // Skip opening sequence "{{" str += 2; @@ -121,8 +119,7 @@ static std::vector getWhiteListDesc() { ++str; if ('\0' == *str) - throw sycl::runtime_error("Malformed device white list", - PI_INVALID_VALUE); + throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE); *size = str - *valuePtr; @@ -136,8 +133,7 @@ static std::vector getWhiteListDesc() { if ('|' == *str) decDescs.emplace_back(); else if (',' != *str) - throw sycl::runtime_error("Malformed device white list", - PI_INVALID_VALUE); + throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE); ++str; } @@ -145,11 +141,10 @@ static std::vector getWhiteListDesc() { return decDescs; } -static void filterWhiteList(vector_class &PiDevices, - RT::PiPlatform PiPlatform, - const plugin &Plugin) { - const std::vector WhiteList(getWhiteListDesc()); - if (WhiteList.empty()) +static void filterAllowList(vector_class &PiDevices, + RT::PiPlatform PiPlatform, const plugin &Plugin) { + const std::vector AllowList(getAllowListDesc()); + if (AllowList.empty()) return; const string_class PlatformName = @@ -170,7 +165,7 @@ static void filterWhiteList(vector_class &PiDevices, const string_class DeviceDriverVer = sycl::detail::get_device_info< string_class, info::device::driver_version>::get(Device, Plugin); - for (const DevDescT &Desc : WhiteList) { + for (const DevDescT &Desc : AllowList) { if (nullptr != Desc.platformName && !std::regex_match(PlatformName, std::regex(std::string(Desc.platformName, @@ -229,9 +224,9 @@ platform_impl::get_devices(info::device_type DeviceType) const { pi::cast(DeviceType), NumDevices, PiDevices.data(), nullptr); - // Filter out devices that are not present in the white list + // Filter out devices that are not present in the allowlist if (SYCLConfig::get()) - filterWhiteList(PiDevices, MPlatform, this->getPlugin()); + filterAllowList(PiDevices, MPlatform, this->getPlugin()); std::transform(PiDevices.begin(), PiDevices.end(), std::back_inserter(Res), [this](const RT::PiDevice &PiDevice) -> device {