Skip to content

Commit 5f30562

Browse files
committed
Addressed most comments
1 parent 6d7db0a commit 5f30562

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

multi_ptr-cast/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
|-------------|--------|
55
| Name | Casting multi_ptr pointers |
66
| Date of Creation | 19 December 2018 |
7-
| Target | SYCL 1.2.1 |
7+
| Target | SYCL 1.2.1 vendor extension |
88
| Current Status | _Work in Progress_ |
99
| Reply-to | Peter Žužek <[email protected]> |
1010
| Original author | Peter Žužek <[email protected]> |
11-
| Contributors | |
11+
| Contributors | Ruyman Reyes <[email protected]> |
1212

1313
## Overview
1414

multi_ptr-cast/sycl-2.2/index.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ we propose adding the following free functions to the `cl::sycl` namespace:
112112
```cpp
113113
namespace cl {
114114
namespace sycl {
115+
namespace codeplay {
115116
116117
// Performs a static_cast of the contained pointer
117118
template <typename ElementTypeU, typename ElementTypeT, access::address_space Space>
@@ -133,6 +134,7 @@ template <typename ElementTypeU, typename ElementTypeT, access::address_space Sp
133134
multi_ptr<ElementTypeU, Space>
134135
reinterpret_pointer_cast(const multi_ptr<ElementTypeT, Space>& multiPtr);
135136
137+
} // namespace codeplay
136138
} // namespace sycl
137139
} // namespace cl
138140
```
@@ -142,7 +144,7 @@ In the table below, each function has the following template parameters:
142144
template <typename ElementTypeU, typename ElementTypeT, access::address_space Space>
143145
```
144146

145-
| Member function | Description |
147+
| Function | Description |
146148
|-----------------|-------------|
147149
| *`multi_ptr<ElementTypeU, Space> static_pointer_cast(const multi_ptr<ElementTypeT, Space>& multiPtr)`* | Performs a `static_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 `static_cast` from `ElementType*` to `ElementTypeU*` is valid. |
148150
| *`multi_ptr<ElementTypeU, Space> dynamic_pointer_cast(const multi_ptr<ElementTypeT, Space>& multiPtr)`* | Performs a `dynamic_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 `dynamic_cast` from `ElementType*` to `ElementTypeU*` is valid. |
@@ -170,10 +172,11 @@ class vec {
170172
### Simple casts
171173
172174
These examples focus on `global_ptr` for brevity,
173-
but it works the same for all `multi_ptr` types.
175+
but the same operation is valid on any other `multi_ptr` type.
174176
175177
```cpp
176178
using namespace cl::sycl;
179+
using namespace codeplay;
177180
const global_ptr<int> ptrInt = get_some_global_ptr<int>();
178181
179182
// Conversion operator
@@ -209,6 +212,7 @@ struct Derived : public Base {
209212
};
210213

211214
using namespace cl::sycl;
215+
using namespace codeplay;
212216
const global_ptr<Base> ptrBase = get_some_global_ptr<int>();
213217

214218
auto ptrDerived = dynamic_pointer_cast<Derived>(ptrBase);
@@ -219,6 +223,7 @@ auto ptrBase1 = dynamic_pointer_cast<Base>(ptrDerived);
219223
220224
```cpp
221225
using namespace cl::sycl;
226+
using namespace codeplay;
222227
223228
template <typename ElementType, access::address_space Space>
224229
void function_taking_ptr(const multi_ptr<ElementType, Space>& ptr);

0 commit comments

Comments
 (0)