Skip to content

[SYCL] Rename variable SYCL_DEVICE_WHITE_LIST. #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/doc/SYCLEnvironmentVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subject to change. Do not rely on these variables in production code.
| SYCL_PRINT_EXECUTION_GRAPH | Described [below](#sycl_print_execution_graph-options) | Print execution graph to DOT text file. |
| SYCL_THROW_ON_BLOCK | Any(*) | Throw an exception on attempt to wait for a blocked command. |
| 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. |

| 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. |
`(*) Note: Any means this environment variable is effective when set to any non-null value.`

## SYCL_PRINT_EXECUTION_GRAPH Options
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/config.def
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
// underscore(__).

CONFIG(SYCL_PRINT_EXECUTION_GRAPH, 32, __SYCL_PRINT_EXECUTION_GRAPH)
CONFIG(SYCL_DEVICE_WHITE_LIST, 1024, __SYCL_DEVICE_WHITE_LIST)
CONFIG(SYCL_DEVICE_ALLOWLIST, 1024, __SYCL_DEVICE_ALLOWLIST)

4 changes: 2 additions & 2 deletions sycl/source/detail/platform_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct DevDescT {
};

static std::vector<DevDescT> getWhiteListDesc() {
const char *str = SYCLConfig<SYCL_DEVICE_WHITE_LIST>::get();
const char *str = SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get();
if (!str)
return {};

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

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

std::transform(PiDevices.begin(), PiDevices.end(), std::back_inserter(Res),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// RUN: env PRINT_PLATFORM_INFO=1 %t.out > %t2.conf
// RUN: env TEST_DEVICE_AVAILABLE=1 env SYCL_CONFIG_FILE_NAME=%t2.conf %t.out
//
// RUN: env TEST_DEVICE_IS_NOT_AVAILABLE=1 env SYCL_DEVICE_WHITE_LIST="PlatformName:{{SUCH NAME DOESN'T EXIST}}" %t.out
// RUN: env TEST_DEVICE_IS_NOT_AVAILABLE=1 env SYCL_DEVICE_ALLOWLIST="PlatformName:{{SUCH NAME DOESN'T EXIST}}" %t.out

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

int main() {

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

std::cout << "SYCL_DEVICE_WHITE_LIST=PlatformName:{{" << Name
std::cout << "SYCL_DEVICE_ALLOWLIST=PlatformName:{{" << Name
<< "}},PlatformVersion:{{" << Ver << "}}";

return 0;
}
throw std::runtime_error("Non host device is not found");
}

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

std::cout << "SYCL_DEVICE_WHITE_LIST=DeviceName:{{" << Name
std::cout << "SYCL_DEVICE_ALLOWLIST=DeviceName:{{" << Name
<< "}},DriverVersion:{{" << Ver << "}}";

return 0;
}
throw std::runtime_error("Non host device is not found");
}

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

// Expected white list to be set but empty
// Expected the allowlist to be set but empty
if (getenv("TEST_DEVICE_IS_NOT_AVAILABLE")) {
for (const sycl::platform &Platform : sycl::platform::get_platforms())
if (!Platform.is_host())
Expand Down