@@ -65,7 +65,7 @@ struct DevDescT {
65
65
int platformVerSize = 0 ;
66
66
};
67
67
68
- static std::vector<DevDescT> getWhiteListDesc () {
68
+ static std::vector<DevDescT> getAllowListDesc () {
69
69
const char *str = SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get ();
70
70
if (!str)
71
71
return {};
@@ -101,15 +101,13 @@ static std::vector<DevDescT> getWhiteListDesc() {
101
101
}
102
102
103
103
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);
106
105
107
106
// Skip ':'
108
107
str += 1 ;
109
108
110
109
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);
113
111
114
112
// Skip opening sequence "{{"
115
113
str += 2 ;
@@ -121,8 +119,7 @@ static std::vector<DevDescT> getWhiteListDesc() {
121
119
++str;
122
120
123
121
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);
126
123
127
124
*size = str - *valuePtr;
128
125
@@ -136,20 +133,18 @@ static std::vector<DevDescT> getWhiteListDesc() {
136
133
if (' |' == *str)
137
134
decDescs.emplace_back ();
138
135
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);
141
137
142
138
++str;
143
139
}
144
140
145
141
return decDescs;
146
142
}
147
143
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 ())
153
148
return ;
154
149
155
150
const string_class PlatformName =
@@ -170,7 +165,7 @@ static void filterWhiteList(vector_class<RT::PiDevice> &PiDevices,
170
165
const string_class DeviceDriverVer = sycl::detail::get_device_info<
171
166
string_class, info::device::driver_version>::get (Device, Plugin);
172
167
173
- for (const DevDescT &Desc : WhiteList ) {
168
+ for (const DevDescT &Desc : AllowList ) {
174
169
if (nullptr != Desc.platformName &&
175
170
!std::regex_match (PlatformName,
176
171
std::regex (std::string (Desc.platformName ,
@@ -229,9 +224,9 @@ platform_impl::get_devices(info::device_type DeviceType) const {
229
224
pi::cast<RT::PiDeviceType>(DeviceType),
230
225
NumDevices, PiDevices.data (), nullptr );
231
226
232
- // Filter out devices that are not present in the white list
227
+ // Filter out devices that are not present in the allowlist
233
228
if (SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get ())
234
- filterWhiteList (PiDevices, MPlatform, this ->getPlugin ());
229
+ filterAllowList (PiDevices, MPlatform, this ->getPlugin ());
235
230
236
231
std::transform (PiDevices.begin (), PiDevices.end (), std::back_inserter (Res),
237
232
[this ](const RT::PiDevice &PiDevice) -> device {
0 commit comments