Skip to content

Commit aa9b82c

Browse files
committed
Removed parts that were merged as SYCL 1.2.1 errata
1 parent 5d262ea commit aa9b82c

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

multi_ptr-cast/sycl-2.2/index.md

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,12 @@ in order to make the casting safer and easier to use.
4242

4343
## Summary
4444

45-
This proposal folds the `void` specialization of the `multi_ptr` class
46-
into the main definition of `multi_ptr<ElementType, Space>`,
47-
handles the cases where `ElementType` is a `const`-qualified type,
48-
adds a few explicit conversion operators
45+
This proposal adds a few explicit conversion operators
4946
as member functions of the `multi_ptr` class,
5047
and also adds several free functions to the `cl::sycl` namespace
5148
that follow the naming and semantics of the `std::shared_ptr` pointer cast functions
5249
defined by the C++17 standard: https://en.cppreference.com/w/cpp/memory/shared_ptr/pointer_cast.
5350

54-
## Specializations for void and const void
55-
56-
In SYCL 1.2.1, the `void` specialization of the `multi_ptr` class
57-
is separate from the main definition
58-
because it cannot contain any reference types.
59-
For the purpose of the specification,
60-
we propose folding the two definitions
61-
into a single definition of the `multi_ptr` class,
62-
with comments denoting which types are available
63-
only if `ElementType` is not `void` or `const void`.
64-
The main reason for this simplification
65-
is the introduction of the specialization for `const void`,
66-
which would require the specification to define another specialization
67-
that would be mostly the same as the specialization for `void`.
68-
Simplifying the definiton like this
69-
also covers the case where `ElementType` is not `void` or `const void`,
70-
but some other `const`-qualified type.
71-
7251
## Explicit conversion operators
7352

7453
The new interface of the `multi_ptr` class would look like this:
@@ -151,22 +130,6 @@ template <typename ElementTypeU, typename ElementTypeT, access::address_space Sp
151130
| *`multi_ptr<ElementTypeU, Space> const_pointer_cast(const multi_ptr<ElementTypeT, Space>& multiPtr)`* | Performs a `const_cast` of the underlying pointer `ElementTypeT*` contained within `multiPtr` to `ElementTypeU*` and returns a new `multi_ptr` instance containing the cast pointer. The address space stays the same. This conversion is only valid if the `const_cast` from `ElementType*` to `ElementTypeU*` is valid. |
152131
| *`multi_ptr<ElementTypeU, Space> reinterpret_pointer_cast(const multi_ptr<ElementTypeT, Space>& multiPtr)`* | Performs a `reinterpret_cast` of the underlying pointer `ElementTypeT*` contained within `multiPtr` to `ElementTypeU*` and returns a new `multi_ptr` instance containing the cast pointer. The address space stays the same. This conversion is only valid if the `reinterpret_cast` from `ElementType*` to `ElementTypeU*` is valid. |
153132

154-
## Add `const` to existing functions taking a `multi_ptr`
155-
156-
For the class `vec`,
157-
use a const-qualified `multi_ptr` for the `load` member function:
158-
159-
```cpp
160-
template <typename dataT, int numElements>
161-
class vec {
162-
public:
163-
/// Existing members
164-
165-
template <access::address_space addressSpace>
166-
void load(size_t offset, multi_ptr<const dataT, addressSpace> ptr);
167-
};
168-
```
169-
170133
## Examples
171134

172135
### Simple casts

0 commit comments

Comments
 (0)