Skip to content

Commit 49e41f7

Browse files
committed
Incorporating code review comments
Signed-off-by: Gail Lyons <[email protected]>
1 parent aff799f commit 49e41f7

File tree

3 files changed

+191
-253
lines changed

3 files changed

+191
-253
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ subject to change. Do not rely on these variables in production code.
2222
| SYCL_DISABLE_EXECUTION_GRAPH_CLEANUP | Any(\*) | Disable cleanup of finished command nodes at host-device synchronization points. |
2323
| SYCL_THROW_ON_BLOCK | Any(\*) | Throw an exception on attempt to wait for a blocked command. |
2424
| SYCL_DEVICELIB_INHIBIT_NATIVE | String of device library extensions (separated by a whitespace) | Do not rely on device native support for devicelib extensions listed in this option. |
25-
| SYCL_DEVICE_ALLOWLIST | A list of devices and their minimum driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Note that the device name, platform name and platform version are regular expressions. Special characters, such as parenthesis, must be escaped. The device driver version is treated as 4 regular expressions, separated by ".". More than one device can be specified using "|".|
25+
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "|".|
2626
| SYCL_QUEUE_THREAD_POOL_SIZE | Positive integer | Number of threads in thread pool of queue. |
2727
| SYCL_DEVICELIB_NO_FALLBACK | Any(\*) | Disable loading and linking of device library images |
2828
| SYCL_PI_LEVEL0_MAX_COMMAND_LIST_CACHE | Positive integer | Maximum number of oneAPI Level Zero Command lists that can be allocated with no reuse before throwing an "out of resources" error. Default is 20000, threshold may be increased based on resource availabilty and workload demand. |

sycl/source/detail/platform_impl.cpp

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -208,62 +208,8 @@ static std::vector<DevDescT> getAllowListDesc() {
208208
return DecDescs;
209209
}
210210

211-
std::vector<int> convertVersionString(std::string Version) {
212-
// version string format is xx.yy.zzzzz.ww WW is optional
213-
std::vector<int> Values;
214-
size_t Pos = 0;
215-
size_t Start = Pos;
216-
if ((Pos = Version.find(".", Pos)) == std::string::npos) {
217-
throw sycl::runtime_error("Malformed syntax in version string",
218-
PI_INVALID_VALUE);
219-
}
220-
Values.push_back(std::stoi(Version.substr(Start, Pos - Start)));
221-
Pos++;
222-
Start = Pos;
223-
if ((Pos = Version.find(".", Pos)) == std::string::npos) {
224-
throw sycl::runtime_error("Malformed syntax in version string",
225-
PI_INVALID_VALUE);
226-
}
227-
Values.push_back(std::stoi(Version.substr(Start, Pos - Start)));
228-
Pos++;
229-
size_t Prev = Pos;
230-
if ((Pos = Version.find(".", Pos)) == std::string::npos) {
231-
Values.push_back(std::stoi(Version.substr(Prev)));
232-
} else {
233-
Values.push_back(std::stoi(Version.substr(Start, Pos - Start)));
234-
Pos++;
235-
Values.push_back(std::stoi(Version.substr(Pos)));
236-
}
237-
return Values;
238-
}
239-
240211
enum MatchState { UNKNOWN, MATCH, NOMATCH };
241212

242-
MatchState matchVersions(std::string Version1, std::string Version2) {
243-
std::vector<int> V1 = convertVersionString(Version1);
244-
std::vector<int> V2 = convertVersionString(Version2);
245-
246-
if (V1.size() != V2.size()) {
247-
return MatchState::NOMATCH;
248-
}
249-
if (V1[0] > V2[0]) {
250-
return MatchState::MATCH;
251-
}
252-
if ((V1[0] == V2[0]) && (V1[1] >= V2[1])) {
253-
return MatchState::MATCH;
254-
}
255-
if ((V1[0] == V2[0]) && (V1[1] == V2[1]) && (V1[2] >= V2[2])) {
256-
return MatchState::MATCH;
257-
}
258-
if (V1.size() == 4) {
259-
if ((V1[0] == V2[0]) && (V1[1] == V2[1]) && (V1[2] == V2[2]) &&
260-
(V1[3] >= V2[3])) {
261-
return MatchState::MATCH;
262-
}
263-
}
264-
return MatchState::NOMATCH;
265-
}
266-
267213
static void filterAllowList(vector_class<RT::PiDevice> &PiDevices,
268214
RT::PiPlatform PiPlatform, const plugin &Plugin) {
269215
const std::vector<DevDescT> AllowList(getAllowListDesc());
@@ -323,10 +269,8 @@ static void filterAllowList(vector_class<RT::PiDevice> &PiDevices,
323269

324270
if (!Desc.DevDriverVer.empty()) {
325271
if (!std::regex_match(DeviceDriverVer, std::regex(Desc.DevDriverVer))) {
326-
DevVerState = matchVersions(DeviceDriverVer, Desc.DevDriverVer);
327-
if (DevVerState == MatchState::NOMATCH) {
328-
continue;
329-
}
272+
DevVerState = MatchState::NOMATCH;
273+
continue;
330274
} else {
331275
DevVerState = MatchState::MATCH;
332276
}

0 commit comments

Comments
 (0)