Skip to content

Commit

Permalink
Merge pull request #709 from vladimirkhashev/test_plan_for_ext_oneapi…
Browse files Browse the repository at this point in the history
…_queue_empty

Test plan for oneapi "queue empty" extension
  • Loading branch information
bader authored Jun 21, 2023
2 parents 82cb0f8 + 3135dcc commit 9855b78
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions test_plans/oneapi_queue_empty.asciidoc
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`

0 comments on commit 9855b78

Please sign in to comment.