-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test plan for SYCL_KHR_GROUP_INTERFACE
#1023
Open
0x12CC
wants to merge
1
commit into
KhronosGroup:main
Choose a base branch
from
0x12CC:sycl_khr_group_interface_test_plan
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,103 @@ | ||
:sectnums: | ||
:xrefstyle: short | ||
|
||
= Test plan for SYCL extension KHR group interface | ||
|
||
This is a test plan for an extension that defines a new interface for groups | ||
described in | ||
https://github.com/KhronosGroup/SYCL-Docs/blob/b05db85e72f489ea10d8b87f111624719425614d/adoc/extensions/sycl_khr_group_interface.adoc[sycl_khr_group_interface]. | ||
|
||
== 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 | ||
|
||
The tests should statically check that the `SYCL_KHR_GROUP_INTERFACE` macro is | ||
defined. | ||
|
||
== Tests | ||
|
||
The test cases should test the interface of each of the following classes | ||
defined in the extension: | ||
|
||
* `sycl::khr::work_group<Dimensions>` | ||
* `sycl::khr::sub_group` | ||
* `sycl::khr::work_item<sycl::khr::work_group<Dimensions>>` | ||
* `sycl::khr::work_item<sycl::khr::sub_group>` | ||
|
||
These test cases should run ND-range kernels with `Dimensions` equal to 1, 2, | ||
and 3. | ||
|
||
=== Test description | ||
|
||
==== `work_group<Dimensions>` class | ||
|
||
In the kernel scope, do the following: | ||
|
||
* Define a `sycl::khr::work_group<Dimensions>` named `work_group` using `it.get_group()`. | ||
* Define a `sycl::group<Dimensions>` named `group` using `it.get_group()`. | ||
* Check that `work_group.id()` returns a `work_group<Dimensions>::id_type`. | ||
* Check that `work_group.id() == group.get_group_id()`. | ||
* Check that `work_group.linear_id()` returns a `work_group<Dimensions>::linear_id_type`. | ||
* Check that `work_group.linear_id() == group.get_group_linear_id()`. | ||
* Check that `work_group.range()` returns a `work_group<Dimensions>::range_type`. | ||
* Check that `work_group.range() == group.get_group_range()`. | ||
* Check that `work_group.size()` returns a `work_group<Dimensions>::size_type`. | ||
* Check that `work_group.size() == group.get_local_linear_range()`. | ||
* Check that `sycl::khr::leader_of(work_group)` returns a `bool`. | ||
* Check that `sycl::khr::leader_of(work_group) == group.leader()`. | ||
|
||
==== `sub_group` class | ||
|
||
In the kernel scope, do the following: | ||
|
||
* Define a `sycl::khr::sub_group` name `sub_group` using `it.get_sub_group()`. | ||
* Define a `sycl::sub_group` name `group` using `it.get_sub_group()`. | ||
* Check that `sub_group.id()` returns a `sub_group::id_type`. | ||
* Check that `sub_group.id() == group.get_group_id()`. | ||
* Check that `sub_group.linear_id()` returns a `sub_group::linear_id_type`. | ||
* Check that `sub_group.linear_id() == group.get_group_linear_id()`. | ||
* Check that `sub_group.range()` returns a `sub_group::range_type`. | ||
* Check that `sub_group.range() == group.get_group_range()`. | ||
* Check that `sub_group.size()` returns a `sub_group::size_type`. | ||
* Check that `sub_group.size() == group.get_local_range()[0]`. | ||
* Check that `sub_group.max_size()` returns a `sub_group::size_type`. | ||
* Check that `sub_group.max_size() == group.get_max_local_range()[0]`. | ||
* Check that `sycl::khr::leader_of(sub_group)` returns a `bool`. | ||
* Check that `sycl::khr::leader_of(sub_group) == group.leader()`. | ||
|
||
==== `work_item<work_group<Dimensions>>` class | ||
|
||
In the kernel scope, do the following: | ||
|
||
* Define a `sycl::group<Dimensions>` named `group` using `it.get_group()`. | ||
* Define a `sycl::khr::work_group<Dimensions>` named `work_group` using `it.get_group()`. | ||
* Define a `sycl::khr::work_item<sycl::khr::work_group<Dimensions>>` named `item` using `sycl::khr::get_item(work_group)`. | ||
* Check that `item.id()` returns a `work_item<>::id_type`. | ||
* Check that `item.id() == group.get_local_id()`. | ||
* Check that `item.linear_id()` returns a `work_item<>::linear_id_type`. | ||
* Check that `item.linear_id() == group.get_local_linear_id()`. | ||
* Check that `item.range()` returns a `work_item<>::range_type`. | ||
* Check that `item.range() == group.get_local_range()`. | ||
* Check that `item.size()` returns a `work_item<>::size_type`. | ||
* Check that `item.size() == 1`. | ||
|
||
==== `work_item<sub_group>` class | ||
|
||
In the kernel scope, do the following: | ||
|
||
* Define a `sycl::sub_group` named `group` using `it.get_sub_group()`. | ||
* Define a `sycl::khr::sub_group` named `sub_group` using `it.get_sub_group()`. | ||
* Define a `sycl::khr::work_item<sycl::khr::sub_group>` named `item` using `sycl::khr::get_item(sub_group)`. | ||
* Check that `item.id()` returns a `work_item<>::id_type`. | ||
* Check that `item.id() == group.get_local_id()`. | ||
* Check that `item.linear_id()` returns a `work_item<>::linear_id_type`. | ||
* Check that `item.linear_id() == group.get_local_linear_id()`. | ||
* Check that `item.range()` returns a `work_item<>::range_type`. | ||
* Check that `item.range() == group.get_local_range()`. | ||
* Check that `item.size()` returns a `work_item<>::size_type`. | ||
* Check that `item.size() == 1`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking: Are you using
work_item<>::id_type
here as a shorthand forwork_item<sycl::khr::work_group<Dimensions>>::id_type
?Somebody might misinterpret this as
work_item<>
(i.e., the class with the template arguments defaulted). I've not reviewed one of these test plans before, but if you think it's important to be unambiguous here you could say something like:Same comment for the other
work_item
functions.