Commit 7905e94
committed
CP023 Accessor aliases, revision 0.3
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 5.
It achieves this by slightly revising how to treat read-only data
and adding alias templates based on the access target.
1. Main changes
* Default accessor template parameters
* Simplify access modes
* Alias templates based on access target
* Extend the handler class
2. Accessor alias templates
* `constant_buffer_accessor
* `host_accessor` as a new type
3. Treat `const T` the same as `access::mode::read`
* Simplifies a lot of code
4. Define implicit conversions for equivalent types
5. Implicit conversions that add `const`
6. Added `property::discard`
7. Overload for `handler::require` that also takes `property::discard`
* To ignore previous data
8. Default all accessor template parameters
* Expect the data type
* Default to an accessor to global buffer with read-write access
* Assumes accessors can be a placeholder without template parameter
9. Good support for CTAD
* Deduction tags as compile-time properties
* Made all accessor constructors variadic templates
10. Discussed some considerations and alternatives
11. Examples of reduced verbosity1 parent 736ef71 commit 7905e94
3 files changed
+198
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
0 commit comments