Skip to content
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

mem_channel extension test plan #727

Merged
merged 6 commits into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions test_plans/mem_channel.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
:sectnums:
:xrefstyle: short

= Test plan for mem_channel

This is a test plan for the APIs described in
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_intel_mem_channel_property.asciidoc[sycl_ext_intel_mem_channel]

== 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_INTEL_MEM_CHANNEL_PROPERTY` so they can be skipped
if feature is not supported.

== Tests

=== buffer with property

* Create a property list with `property::buffer::mem_channel` property;
* Create a `mem_channel` instance using `property::buffer::mem_channel::mem_channel(cl_uint channel)` constructor;
* Create buffers sing these property list and property instance;
* Verify that `buffer::has_property<mem_channel>()` returns true;
* Verify that `buffer::get_property<mem_channel>()` does not throw any exceptions.
* Run the code below to make sure that buffers work correctly:
[source, c++]
----
property_list pl = {mem_channel(0)};
mem_channel mc_object(1);

std::array<int, 10> arr1{};
std::array<int, 10> arr2{};
{
buffer<T, 1> buf1(arr1.data(), range{10}, pl);
buffer<T, 1> buf2(arr2.data(), range{10}, mc_object);

queue.submit([&](handler& cgh) {
accessor acc1{buf1, cgh, write_only};
accessor acc2{buf2, cgh, write_only};
cgh.parallel_for([=](id<1> i) {
// some data manipulations
});
});
}
// verify data in arrays
----

=== get_channel() member function

* Use property list and `mem_channel` object to call `get_channel() member function`:
[source, c++]
----
auto channel_1 = pl.get_property<mem_channel>().get_channel();
auto channel_2 = mc_object.get_channel();
----

* Check that `get_channel()` returns expected values
* Check that `std::is_same_v<decltype(channel_1), uint32_t>` and `std::is_same_v<decltype(channel_1), uint32_t>` are `true`.