Commit 98418af
committed
Accessor aliases
In order to reduce the verbosity of programming with SYCL accessors,
this proposal aims to reduce the number of template parameters
to just 2 from the current 4 (placeholders accessors even have 5).
It achieves this by adding aliases to accessors
based on the access target
and slightly revised rules for access modes.
1. Added aliases to accessors
* `buffer_accessor`,
* `constant_buffer_accessor
* `host_accessor`
2. Deduce access mode based on constness of data type
* `access::mode::read` for `const dataT`
* `access::mode::read_write` for `dataT`
3. Allow conversions to new aliases
4. Return aliases from buffer access
* `get_device_access`
* `get_device_constant_access`
* `get_host_access`
5. Allow any accessor to be registered with `handler::require`
6. Overload for `handler::require` that also takes an access mode
* Hint to the scheduler
7. Type traits to help with deducing access modes
* `access_mode_from_type`
* `type_from_access_mode`
8. Default all accessor template parameters
* Expect the data type
* Default to an accessor to global buffer with read-write access
* Assumes any accessor can be a placeholder
9. Discussed some considerations and alternatives
10. Examples of reduced verbosity1 parent c9c87e8 commit 98418af
3 files changed
+592
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments