Skip to content

Commit 2c3908b

Browse files
[SYCL][PI][L0] Update environment variables from LEVEL0 to LEVEL_ZERO (#2612)
1 parent 1bafa20 commit 2c3908b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ subject to change. Do not rely on these variables in production code.
2626
| 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 "\|".|
2727
| SYCL_QUEUE_THREAD_POOL_SIZE | Positive integer | Number of threads in thread pool of queue. |
2828
| SYCL_DEVICELIB_NO_FALLBACK | Any(\*) | Disable loading and linking of device library images |
29-
| 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. |
30-
| SYCL_PI_LEVEL0_DISABLE_USM_ALLOCATOR | Any(\*) | Disable USM allocator in Level Zero plugin (each memory request will go directly to Level Zero runtime) |
29+
| SYCL_PI_LEVEL_ZERO_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. |
30+
| SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR | Any(\*) | Disable USM allocator in Level Zero plugin (each memory request will go directly to Level Zero runtime) |
3131
| SYCL_PI_LEVEL_ZERO_BATCH_SIZE | Positive integer | Sets a preferred number of commands to batch into a command list before executing the command list. Values 0 and 1 turn off batching. Default is 4. |
3232

3333
`(*) Note: Any means this environment variable is effective when set to any non-null value.`

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,14 +765,15 @@ static pi_result getOrCreatePlatform(ze_driver_handle_t ZeDriver,
765765
// it only has to be executed once
766766
static pi_uint32 CommandListCacheSizeValue = ([] {
767767
const char *CommandListCacheSize =
768-
std::getenv("SYCL_PI_LEVEL0_MAX_COMMAND_LIST_CACHE");
768+
std::getenv("SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE");
769769
pi_uint32 CommandListCacheSizeValue;
770770
try {
771771
CommandListCacheSizeValue =
772772
CommandListCacheSize ? std::stoi(CommandListCacheSize) : 20000;
773773
} catch (std::exception const &) {
774-
zePrint("SYCL_PI_LEVEL0_MAX_COMMAND_LIST_CACHE: invalid value provided, "
775-
"default set.\n");
774+
zePrint(
775+
"SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE: invalid value provided, "
776+
"default set.\n");
776777
CommandListCacheSizeValue = 20000;
777778
}
778779
return CommandListCacheSizeValue;
@@ -4452,7 +4453,7 @@ pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context,
44524453

44534454
static bool ShouldUseUSMAllocator() {
44544455
// Enable allocator by default if it's not explicitly disabled
4455-
return std::getenv("SYCL_PI_LEVEL0_DISABLE_USM_ALLOCATOR") == nullptr;
4456+
return std::getenv("SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR") == nullptr;
44564457
}
44574458

44584459
static const bool UseUSMAllocator = ShouldUseUSMAllocator();

sycl/plugins/level_zero/pi_level_zero.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ struct _pi_platform {
8484

8585
// Maximum Number of Command Lists that can be created.
8686
// This Value is initialized to 20000, but can be changed by the user
87-
// thru the environment variable SYCL_PI_LEVEL0_MAX_COMMAND_LIST_CACHE
88-
// ie SYCL_PI_LEVEL0_MAX_COMMAND_LIST_CACHE =10000.
87+
// thru the environment variable SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE
88+
// ie SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE =10000.
8989
int ZeMaxCommandListCache = 0;
9090

9191
// Current number of L0 Command Lists created on this platform.

0 commit comments

Comments
 (0)