Skip to content

Commit 76f7e8b

Browse files
author
Artem Gindinson
authored
[SYCL][NFC] Reflect the "allowlist" renaming in the code (#1480)
This should finalize the renaming introduced by [4df18fa], making the whole setting more consistent. Signed-off-by: Artem Gindinson <[email protected]>
1 parent 5d0d034 commit 76f7e8b

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

sycl/source/detail/platform_impl.cpp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct DevDescT {
6565
int platformVerSize = 0;
6666
};
6767

68-
static std::vector<DevDescT> getWhiteListDesc() {
68+
static std::vector<DevDescT> getAllowListDesc() {
6969
const char *str = SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get();
7070
if (!str)
7171
return {};
@@ -101,15 +101,13 @@ static std::vector<DevDescT> getWhiteListDesc() {
101101
}
102102

103103
if (':' != *str)
104-
throw sycl::runtime_error("Malformed device white list",
105-
PI_INVALID_VALUE);
104+
throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE);
106105

107106
// Skip ':'
108107
str += 1;
109108

110109
if ('{' != *str || '{' != *(str + 1))
111-
throw sycl::runtime_error("Malformed device white list",
112-
PI_INVALID_VALUE);
110+
throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE);
113111

114112
// Skip opening sequence "{{"
115113
str += 2;
@@ -121,8 +119,7 @@ static std::vector<DevDescT> getWhiteListDesc() {
121119
++str;
122120

123121
if ('\0' == *str)
124-
throw sycl::runtime_error("Malformed device white list",
125-
PI_INVALID_VALUE);
122+
throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE);
126123

127124
*size = str - *valuePtr;
128125

@@ -136,20 +133,18 @@ static std::vector<DevDescT> getWhiteListDesc() {
136133
if ('|' == *str)
137134
decDescs.emplace_back();
138135
else if (',' != *str)
139-
throw sycl::runtime_error("Malformed device white list",
140-
PI_INVALID_VALUE);
136+
throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE);
141137

142138
++str;
143139
}
144140

145141
return decDescs;
146142
}
147143

148-
static void filterWhiteList(vector_class<RT::PiDevice> &PiDevices,
149-
RT::PiPlatform PiPlatform,
150-
const plugin &Plugin) {
151-
const std::vector<DevDescT> WhiteList(getWhiteListDesc());
152-
if (WhiteList.empty())
144+
static void filterAllowList(vector_class<RT::PiDevice> &PiDevices,
145+
RT::PiPlatform PiPlatform, const plugin &Plugin) {
146+
const std::vector<DevDescT> AllowList(getAllowListDesc());
147+
if (AllowList.empty())
153148
return;
154149

155150
const string_class PlatformName =
@@ -170,7 +165,7 @@ static void filterWhiteList(vector_class<RT::PiDevice> &PiDevices,
170165
const string_class DeviceDriverVer = sycl::detail::get_device_info<
171166
string_class, info::device::driver_version>::get(Device, Plugin);
172167

173-
for (const DevDescT &Desc : WhiteList) {
168+
for (const DevDescT &Desc : AllowList) {
174169
if (nullptr != Desc.platformName &&
175170
!std::regex_match(PlatformName,
176171
std::regex(std::string(Desc.platformName,
@@ -229,9 +224,9 @@ platform_impl::get_devices(info::device_type DeviceType) const {
229224
pi::cast<RT::PiDeviceType>(DeviceType),
230225
NumDevices, PiDevices.data(), nullptr);
231226

232-
// Filter out devices that are not present in the white list
227+
// Filter out devices that are not present in the allowlist
233228
if (SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get())
234-
filterWhiteList(PiDevices, MPlatform, this->getPlugin());
229+
filterAllowList(PiDevices, MPlatform, this->getPlugin());
235230

236231
std::transform(PiDevices.begin(), PiDevices.end(), std::back_inserter(Res),
237232
[this](const RT::PiDevice &PiDevice) -> device {

0 commit comments

Comments
 (0)