[SYCL] add e2e tests for batched queues in L0v1 and L0v2 (#21193)
This patch adds a new `RUN` directive in selected SYCL e2e tests, in
order to check the support for batched queue submissions in L0v2.
Batched queue submissions are introduced to L0v2 and described in the
following PR: #19769.
The directive contains the environment variables which are specific to
either L0v1 or L0v2 and are responsible for forcing batched submissions:
`// RUN: %if level_zero %{ env
SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 UR_L0_V2_FORCE_BATCHED=1
%{run} %t.out %}`
When executing tests with L0v1, `UR_L0_V2_FORCE_BATCHED` is ignored and
only `SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS` is used.
Conversely, L0v2 ignores `SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS`
and uses only `UR_L0_V2_FORCE_BATCHED`. This way batched submissions are
forced regardless of the available L0 adapter version.
Although the tests are added to verify the new functionality in L0v2, at
this moment, it is not possible to restrict the test scope only to L0v2.
The keyword `level_zero_v2_adapter`, used with the `UNSUPPORTED`
directive, is not recognized inside the `RUN` directive. Additionally,
`%if level_zero` recognizes both L0v1 and L0v2. In the following
example:
```
// RUN: %{run} %t.out
// RUN: %if level_zero %{env UR_L0_V2_FORCE_BATCHED=1 %{run} %t.out %}
```
in case of L0v1, we duplicate the test execution without any change. In
case of L0v2, the first line executes the test with an immediate queue,
whereas the second line executes with a batched queue. When adding
`SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0` to force batched
submissions for L0v1 as well, the second `RUN` for L0v1 becomes a
different test case: batched queues are used instead of immediate queues
and repeating the unmodified scenario from the first `RUN` is avoided.