-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #709 from vladimirkhashev/test_plan_for_ext_oneapi…
…_queue_empty Test plan for oneapi "queue empty" extension
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
:sectnums: | ||
:xrefstyle: short | ||
|
||
= Test plan for sycl extension oneapi queue empty | ||
|
||
This is a test plan for the extension adding a new API that tells whether a | ||
queue is empty. The extension is described in | ||
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_empty.asciidoc[sycl_ext_oneapi_queue_empty.asciidoc]. | ||
|
||
== Testing scope | ||
|
||
=== Device coverage | ||
|
||
All of the tests described below are performed only on the default device that | ||
is selected on the CTS command line. | ||
|
||
=== Feature test macro | ||
|
||
All of the tests should use `#ifdef SYCL_EXT_ONEAPI_QUEUE_EMPTY` so they can | ||
be skipped if feature is not supported. | ||
|
||
== Tests | ||
|
||
Extension introduces the following member function for the `sycl::queue` class: | ||
|
||
[source, c++] | ||
---- | ||
bool ext_oneapi_empty() const | ||
---- | ||
|
||
We should check the function returns `true` when all commands submitted to the | ||
queue are completed and `false` otherwise. | ||
|
||
=== Test description | ||
|
||
==== `ext_oneapi_empty()` is called when no commands are submitted | ||
|
||
* Create queue | ||
* Call `ext_oneapi_empty()` | ||
* Check the type of returned value | ||
* Check that returned value is `true` | ||
|
||
==== `ext_oneapi_empty()` is called after commands submission | ||
|
||
===== Test 1: | ||
|
||
* Create queue | ||
* Define and submit a kernel performing some actions in long loop, save | ||
returned event E | ||
* Call `ext_oneapi_empty()` | ||
* If `E.get_info<command_execution_status>() != complete` check that returned | ||
value of `ext_oneapi_empty()` is `false` | ||
* Call `wait()` for the queue | ||
* Call `ext_oneapi_empty()` again | ||
* Check that returned value is `true` | ||
|
||
===== Test 2: | ||
|
||
* Create queue | ||
* Define two kernels performing some actions in long loop, let it be kernels | ||
`A` and `B` | ||
* Kernel `B` must depends on kernel `A` so that it can only be started its work | ||
after kernel `A` has completed | ||
* Submit kernel `A` and `B`, save events `Ea` and `Eb` | ||
* Call `wait()` for event `Ea` | ||
* Call `ext_oneapi_empty()` | ||
* If `Eb.get_info<command_execution_status>() != complete` check that returned | ||
value of `ext_oneapi_empty()` is `false` | ||
* Call `wait()` for event `Eb` | ||
* Call `ext_oneapi_empty()` again | ||
* Check that returned value is `true` |