Skip to content

Commit 4df18fa

Browse files
authored
[SYCL] Rename variable SYCL_DEVICE_WHITE_LIST. (#1088)
Rename variable SYCL_DEVICE_WHITE_LIST to SYCL_DEVICE_ALLOW_LIST and add description to the SYCLEnvironmentVariables.md doc. Signed-off-by: amochalo <anastasiya.mochalova@intel.com>
1 parent 7c293e2 commit 4df18fa

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

sycl/doc/SYCLEnvironmentVariables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ subject to change. Do not rely on these variables in production code.
2020
| SYCL_PRINT_EXECUTION_GRAPH | Described [below](#sycl_print_execution_graph-options) | Print execution graph to DOT text file. |
2121
| SYCL_THROW_ON_BLOCK | Any(*) | Throw an exception on attempt to wait for a blocked command. |
2222
| 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. |
23-
23+
| 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 SYCL RT will select only those devices which satisfy the regex. |
2424
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
2525

2626
## SYCL_PRINT_EXECUTION_GRAPH Options

sycl/source/detail/config.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// underscore(__).
1212

1313
CONFIG(SYCL_PRINT_EXECUTION_GRAPH, 32, __SYCL_PRINT_EXECUTION_GRAPH)
14-
CONFIG(SYCL_DEVICE_WHITE_LIST, 1024, __SYCL_DEVICE_WHITE_LIST)
14+
CONFIG(SYCL_DEVICE_ALLOWLIST, 1024, __SYCL_DEVICE_ALLOWLIST)
1515

sycl/source/detail/platform_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct DevDescT {
6262
};
6363

6464
static std::vector<DevDescT> getWhiteListDesc() {
65-
const char *str = SYCLConfig<SYCL_DEVICE_WHITE_LIST>::get();
65+
const char *str = SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get();
6666
if (!str)
6767
return {};
6868

@@ -217,7 +217,7 @@ platform_impl::get_devices(info::device_type DeviceType) const {
217217
NumDevices, PiDevices.data(), nullptr);
218218

219219
// Filter out devices that are not present in the white list
220-
if (SYCLConfig<SYCL_DEVICE_WHITE_LIST>::get())
220+
if (SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get())
221221
filterWhiteList(PiDevices, MPlatform);
222222

223223
std::transform(PiDevices.begin(), PiDevices.end(), std::back_inserter(Res),

sycl/test/config/white_list.cpp renamed to sycl/test/config/allowlist.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: env PRINT_PLATFORM_INFO=1 %t.out > %t2.conf
88
// RUN: env TEST_DEVICE_AVAILABLE=1 env SYCL_CONFIG_FILE_NAME=%t2.conf %t.out
99
//
10-
// RUN: env TEST_DEVICE_IS_NOT_AVAILABLE=1 env SYCL_DEVICE_WHITE_LIST="PlatformName:{{SUCH NAME DOESN'T EXIST}}" %t.out
10+
// RUN: env TEST_DEVICE_IS_NOT_AVAILABLE=1 env SYCL_DEVICE_ALLOWLIST="PlatformName:{{SUCH NAME DOESN'T EXIST}}" %t.out
1111

1212
#include <CL/sycl.hpp>
1313
#include <iostream>
@@ -25,7 +25,7 @@ static void replaceSpecialCharacters(std::string &Str) {
2525

2626
int main() {
2727

28-
// Expected that white list filter is not set
28+
// Expected that the allowlist filter is not set
2929
if (getenv("PRINT_PLATFORM_INFO")) {
3030
for (const sycl::platform &Platform : sycl::platform::get_platforms())
3131
if (!Platform.is_host()) {
@@ -37,15 +37,15 @@ int main() {
3737
replaceSpecialCharacters(Name);
3838
replaceSpecialCharacters(Ver);
3939

40-
std::cout << "SYCL_DEVICE_WHITE_LIST=PlatformName:{{" << Name
40+
std::cout << "SYCL_DEVICE_ALLOWLIST=PlatformName:{{" << Name
4141
<< "}},PlatformVersion:{{" << Ver << "}}";
4242

4343
return 0;
4444
}
4545
throw std::runtime_error("Non host device is not found");
4646
}
4747

48-
// Expected that white list filter is not set
48+
// Expected that the allowlist filter is not set
4949
if (getenv("PRINT_DEVICE_INFO")) {
5050
for (const sycl::platform &Platform : sycl::platform::get_platforms())
5151
if (!Platform.is_host()) {
@@ -58,15 +58,15 @@ int main() {
5858
replaceSpecialCharacters(Name);
5959
replaceSpecialCharacters(Ver);
6060

61-
std::cout << "SYCL_DEVICE_WHITE_LIST=DeviceName:{{" << Name
61+
std::cout << "SYCL_DEVICE_ALLOWLIST=DeviceName:{{" << Name
6262
<< "}},DriverVersion:{{" << Ver << "}}";
6363

6464
return 0;
6565
}
6666
throw std::runtime_error("Non host device is not found");
6767
}
6868

69-
// Expected white list to be set with result from "PRINT_DEVICE_INFO" run
69+
// Expected the allowlist to be set with the "PRINT_DEVICE_INFO" run result
7070
if (getenv("TEST_DEVICE_AVAILABLE")) {
7171
for (const sycl::platform &Platform : sycl::platform::get_platforms())
7272
if (!Platform.is_host()) {
@@ -78,7 +78,7 @@ int main() {
7878
throw std::runtime_error("Non host device is not found");
7979
}
8080

81-
// Expected white list to be set but empty
81+
// Expected the allowlist to be set but empty
8282
if (getenv("TEST_DEVICE_IS_NOT_AVAILABLE")) {
8383
for (const sycl::platform &Platform : sycl::platform::get_platforms())
8484
if (!Platform.is_host())

0 commit comments

Comments
 (0)