diff --git a/sycl/doc/SYCLEnvironmentVariables.md b/sycl/doc/SYCLEnvironmentVariables.md index 700b0fac6fc6b..49f6ecde11cdb 100644 --- a/sycl/doc/SYCLEnvironmentVariables.md +++ b/sycl/doc/SYCLEnvironmentVariables.md @@ -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 diff --git a/sycl/source/detail/config.def b/sycl/source/detail/config.def index 552c14c378f61..9ffacb4e1b113 100644 --- a/sycl/source/detail/config.def +++ b/sycl/source/detail/config.def @@ -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) diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index 32bc976f37756..31721c1702a60 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -62,7 +62,7 @@ struct DevDescT { }; static std::vector getWhiteListDesc() { - const char *str = SYCLConfig::get(); + const char *str = SYCLConfig::get(); if (!str) return {}; @@ -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::get()) + if (SYCLConfig::get()) filterWhiteList(PiDevices, MPlatform); std::transform(PiDevices.begin(), PiDevices.end(), std::back_inserter(Res), diff --git a/sycl/test/config/white_list.cpp b/sycl/test/config/allowlist.cpp similarity index 85% rename from sycl/test/config/white_list.cpp rename to sycl/test/config/allowlist.cpp index 0b9db514828ea..a56185c25a7f5 100644 --- a/sycl/test/config/white_list.cpp +++ b/sycl/test/config/allowlist.cpp @@ -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 #include @@ -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()) { @@ -37,7 +37,7 @@ 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; @@ -45,7 +45,7 @@ int main() { 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()) { @@ -58,7 +58,7 @@ 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; @@ -66,7 +66,7 @@ int main() { 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()) { @@ -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())