Skip to content

Commit

Permalink
CP023 Accessor aliases, revision 0.2
Browse files Browse the repository at this point in the history
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`
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. Overload for `handler::require` that also takes an access mode
  * To weaken the access mode
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. Discussed some considerations and alternatives
10. Examples of reduced verbosity
  • Loading branch information
ProGTX committed Mar 9, 2020
1 parent 52680fe commit 27552ed
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 294 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ from this registry in the future.
| CP020 | [Interop Task](interop_task/interop_task.md) | SYCL 1.2.1 | 16 January 2019 | 16 January 2019 | _Available since CE 1.0.5_ |
| CP021 | [Default-Constructed Buffers](default-constructed-buffers/default-constructed-buffers.md) | SYCL 1.2.1 | 27 August 2019 | 5 September 2019 | _Draft_ |
| CP022 | [Host Task with Interop capabilities](host_task/host_task.md) | SYCL 1.2.1 | 16 January 2019 | 20 January 2020 | _Final Draft_ |
| CP023 | [Accessor aliases](accessor-alias/index.md) | SYCL 1.2.1 vendor extension | 22 September 2019 | 5 March 2020 | _Work in Progress_ |
| CP023 | [Accessor aliases](accessor-alias/index.md) | SYCL Next (after 1.2.1) | 22 September 2019 | 9 March 2020 | _Work in Progress_ |
6 changes: 4 additions & 2 deletions accessor-alias/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
|-------------|--------|
| Name | Accessor aliases |
| Date of Creation | 22 September 2019 |
| Target | SYCL 1.2.1 vendor extension |
| Revision | 0.2 |
| Latest Update | 9 March 2020 |
| Target | SYCL Next (after 1.2.1) |
| Current Status | _Work in Progress_ |
| Reply-to | Peter Žužek <[email protected]> |
| Original author | Peter Žužek <[email protected]> |
Expand All @@ -17,4 +19,4 @@ in order to reduce accessor verbosity.

## Versions

[Version 1](sycl-2.2/index.md)
[Revision 0.2](sycl-2.2/index.md)
Loading

0 comments on commit 27552ed

Please sign in to comment.