Skip to content

Commit d1b53a2

Browse files
committed
Add new environment variable to control the use of copy engine for in-order queues
1 parent ae3c397 commit d1b53a2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ subject to change. Do not rely on these variables in production code.
3333
| `SYCL_PI_LEVEL_ZERO_FILTER_EVENT_WAIT_LIST` | Integer | When set to 0, disables filtering of signaled events from wait lists when using the Level Zero backend. The default is 1. |
3434
| `SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE` | Integer | Allows the use of copy engine, if available in the device, in Level Zero plugin to transfer SYCL buffer or image data between the host and/or device(s) and to fill SYCL buffer or image data in device or shared memory. The default is 1. |
3535
| `SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_D2D_COPY` (experimental) | Integer | Allows the use of copy engine, if available in the device, in Level Zero plugin for device to device copy operations. The default is 0. This option is experimental and will be removed once heuristics are added to make a decision about use of copy engine for device to device copy operations. |
36+
| `SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE` (experimental) | Integer | Allows the use of copy engine, if available in the device, in Level Zero plugin for copy operations submitted to an in-order queue. The default is 0. |
3637
| `SYCL_PI_LEVEL_ZERO_TRACK_INDIRECT_ACCESS_MEMORY` | Any(\*) | Enable support of the kernels with indirect access and corresponding deferred release of memory allocations in the Level Zero plugin. |
3738
| `SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE` | Any(\*) | Enables tracing of `parallel_for` invocations with rounded-up ranges. |
3839
| `SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING` | Any(\*) | Disables automatic rounding-up of `parallel_for` invocation ranges. |

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ static const bool UseCopyEngineForD2DCopy = [] {
6060
return (CopyEngineForD2DCopy && (std::stoi(CopyEngineForD2DCopy) != 0));
6161
}();
6262

63+
// This is an experimental option to test performance of use copy engine for
64+
// in order queue copy operations on copy engines (versus compute engine)
65+
static const bool UseCopyEngineForInOrderQueue = [] {
66+
const char *CopyEngineForInOrderQueue =
67+
std::getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE");
68+
return (CopyEngineForInOrderQueue &&
69+
(std::stoi(CopyEngineForInOrderQueue) != 0));
70+
}();
71+
6372
static const bool CopyEngineRequested = [] {
6473
const char *CopyEngine = std::getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE");
6574
bool UseCopyEngine = (!CopyEngine || (std::stoi(CopyEngine) != 0));

0 commit comments

Comments
 (0)