Skip to content

Commit 9d60c3d

Browse files
authored
[SYCL][NFC] Rename PtrValueType to DecoratedType (#3173)
1 parent 0f401bf commit 9d60c3d

File tree

5 files changed

+28
-27
lines changed

5 files changed

+28
-27
lines changed

sycl/include/CL/sycl/access/access.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,30 @@ template <> struct TargetToAS<access::target::constant_buffer> {
147147
};
148148

149149
template <typename ElementType, access::address_space addressSpace>
150-
struct PtrValueType;
150+
struct DecoratedType;
151151

152152
template <typename ElementType>
153-
struct PtrValueType<ElementType, access::address_space::private_space> {
153+
struct DecoratedType<ElementType, access::address_space::private_space> {
154154
using type = __OPENCL_PRIVATE_AS__ ElementType;
155155
};
156156

157157
template <typename ElementType>
158-
struct PtrValueType<ElementType, access::address_space::global_space> {
158+
struct DecoratedType<ElementType, access::address_space::global_space> {
159159
using type = __OPENCL_GLOBAL_AS__ ElementType;
160160
};
161161

162162
template <typename ElementType>
163-
struct PtrValueType<ElementType, access::address_space::global_device_space> {
163+
struct DecoratedType<ElementType, access::address_space::global_device_space> {
164164
using type = __OPENCL_GLOBAL_DEVICE_AS__ ElementType;
165165
};
166166

167167
template <typename ElementType>
168-
struct PtrValueType<ElementType, access::address_space::global_host_space> {
168+
struct DecoratedType<ElementType, access::address_space::global_host_space> {
169169
using type = __OPENCL_GLOBAL_HOST_AS__ ElementType;
170170
};
171171

172172
template <typename ElementType>
173-
struct PtrValueType<ElementType, access::address_space::constant_space> {
173+
struct DecoratedType<ElementType, access::address_space::constant_space> {
174174
// Current implementation of address spaces handling leads to possibility
175175
// of emitting incorrect (in terms of OpenCL) address space casts from
176176
// constant to generic (and vise-versa). So, global address space is used here
@@ -184,7 +184,7 @@ struct PtrValueType<ElementType, access::address_space::constant_space> {
184184
};
185185

186186
template <typename ElementType>
187-
struct PtrValueType<ElementType, access::address_space::local_space> {
187+
struct DecoratedType<ElementType, access::address_space::local_space> {
188188
using type = __OPENCL_LOCAL_AS__ ElementType;
189189
};
190190

sycl/include/CL/sycl/accessor.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ class accessor :
798798
using AccessorSubscript =
799799
typename AccessorCommonT::template AccessorSubscript<Dims>;
800800

801-
using ConcreteASPtrType = typename detail::PtrValueType<DataT, AS>::type *;
801+
using ConcreteASPtrType = typename detail::DecoratedType<DataT, AS>::type *;
802802

803803
using RefType = detail::const_if_const_AS<AS, DataT> &;
804804
using ConstRefType = const DataT &;
@@ -1792,7 +1792,7 @@ class accessor<DataT, Dimensions, AccessMode, access::target::local,
17921792
using AccessorSubscript =
17931793
typename AccessorCommonT::template AccessorSubscript<Dims>;
17941794

1795-
using ConcreteASPtrType = typename detail::PtrValueType<DataT, AS>::type *;
1795+
using ConcreteASPtrType = typename detail::DecoratedType<DataT, AS>::type *;
17961796

17971797
using RefType = detail::const_if_const_AS<AS, DataT> &;
17981798
using PtrType = detail::const_if_const_AS<AS, DataT> *;

sycl/include/CL/sycl/atomic.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class atomic {
318318

319319
private:
320320
#ifdef __SYCL_DEVICE_ONLY__
321-
typename detail::PtrValueType<T, addressSpace>::type *Ptr;
321+
typename detail::DecoratedType<T, addressSpace>::type *Ptr;
322322
#else
323323
std::atomic<T> *Ptr;
324324
#endif

sycl/include/CL/sycl/detail/generic_type_traits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ template <typename T> class TryToGetVectorT {
324324
template <typename T> class TryToGetPointerVecT {
325325
static T check(...);
326326
template <typename A>
327-
static typename PtrValueType<
327+
static typename DecoratedType<
328328
typename TryToGetVectorT<typename TryToGetElementType<A>::type>::type,
329329
A::address_space>::type *
330330
check(const A &);

sycl/include/CL/sycl/multi_ptr.hpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ template <typename ElementType, access::address_space Space> class multi_ptr {
3636

3737
// Implementation defined pointer and reference types that correspond to
3838
// SYCL/OpenCL interoperability types for OpenCL C functions
39-
using pointer_t = typename detail::PtrValueType<ElementType, Space>::type *;
39+
using pointer_t = typename detail::DecoratedType<ElementType, Space>::type *;
4040
using const_pointer_t =
41-
typename detail::PtrValueType<ElementType, Space>::type const *;
42-
using reference_t = typename detail::PtrValueType<ElementType, Space>::type &;
41+
typename detail::DecoratedType<ElementType, Space>::type const *;
42+
using reference_t =
43+
typename detail::DecoratedType<ElementType, Space>::type &;
4344
using const_reference_t =
44-
typename detail::PtrValueType<ElementType, Space>::type &;
45+
typename detail::DecoratedType<ElementType, Space>::type &;
4546

4647
static constexpr access::address_space address_space = Space;
4748

@@ -224,7 +225,7 @@ template <typename ElementType, access::address_space Space> class multi_ptr {
224225
!std::is_const<ET>::value,
225226
void>::type,
226227
Space>() const {
227-
using ptr_t = typename detail::PtrValueType<void, Space> *;
228+
using ptr_t = typename detail::DecoratedType<void, Space> *;
228229
return multi_ptr<void, Space>(reinterpret_cast<ptr_t>(m_Pointer));
229230
}
230231

@@ -236,14 +237,14 @@ template <typename ElementType, access::address_space Space> class multi_ptr {
236237
std::is_const<ET>::value,
237238
const void>::type,
238239
Space>() const {
239-
using ptr_t = typename detail::PtrValueType<const void, Space> *;
240+
using ptr_t = typename detail::DecoratedType<const void, Space> *;
240241
return multi_ptr<const void, Space>(reinterpret_cast<ptr_t>(m_Pointer));
241242
}
242243

243244
// Implicit conversion to multi_ptr<const ElementType, Space>
244245
operator multi_ptr<const ElementType, Space>() const {
245246
using ptr_t =
246-
typename detail::PtrValueType<const ElementType, Space>::type *;
247+
typename detail::DecoratedType<const ElementType, Space>::type *;
247248
return multi_ptr<const ElementType, Space>(
248249
reinterpret_cast<ptr_t>(m_Pointer));
249250
}
@@ -293,7 +294,7 @@ template <typename ElementType, access::address_space Space> class multi_ptr {
293294
Space == access::address_space::global_host_space)>>
294295
explicit
295296
operator multi_ptr<ElementType, access::address_space::global_space>() const {
296-
using global_pointer_t = typename detail::PtrValueType<
297+
using global_pointer_t = typename detail::DecoratedType<
297298
ElementType, access::address_space::global_space>::type *;
298299
return multi_ptr<ElementType, access::address_space::global_space>(
299300
reinterpret_cast<global_pointer_t>(m_Pointer));
@@ -307,7 +308,7 @@ template <typename ElementType, access::address_space Space> class multi_ptr {
307308
_Space == Space && Space == access::address_space::global_space>>
308309
void prefetch(size_t NumElements) const {
309310
size_t NumBytes = NumElements * sizeof(ElementType);
310-
using ptr_t = typename detail::PtrValueType<char, Space>::type const *;
311+
using ptr_t = typename detail::DecoratedType<char, Space>::type const *;
311312
__spirv_ocl_prefetch(reinterpret_cast<ptr_t>(m_Pointer), NumBytes);
312313
}
313314

@@ -323,9 +324,9 @@ template <access::address_space Space> class multi_ptr<void, Space> {
323324

324325
// Implementation defined pointer types that correspond to
325326
// SYCL/OpenCL interoperability types for OpenCL C functions
326-
using pointer_t = typename detail::PtrValueType<void, Space>::type *;
327+
using pointer_t = typename detail::DecoratedType<void, Space>::type *;
327328
using const_pointer_t =
328-
typename detail::PtrValueType<void, Space>::type const *;
329+
typename detail::DecoratedType<void, Space>::type const *;
329330

330331
static constexpr access::address_space address_space = Space;
331332

@@ -420,14 +421,14 @@ template <access::address_space Space> class multi_ptr<void, Space> {
420421
template <typename ElementType>
421422
explicit operator multi_ptr<ElementType, Space>() const {
422423
using elem_pointer_t =
423-
typename detail::PtrValueType<ElementType, Space>::type *;
424+
typename detail::DecoratedType<ElementType, Space>::type *;
424425
return multi_ptr<ElementType, Space>(
425426
static_cast<elem_pointer_t>(m_Pointer));
426427
}
427428

428429
// Implicit conversion to multi_ptr<const void, Space>
429430
operator multi_ptr<const void, Space>() const {
430-
using ptr_t = typename detail::PtrValueType<const void, Space>::type *;
431+
using ptr_t = typename detail::DecoratedType<const void, Space>::type *;
431432
return multi_ptr<const void, Space>(reinterpret_cast<ptr_t>(m_Pointer));
432433
}
433434

@@ -444,9 +445,9 @@ class multi_ptr<const void, Space> {
444445

445446
// Implementation defined pointer types that correspond to
446447
// SYCL/OpenCL interoperability types for OpenCL C functions
447-
using pointer_t = typename detail::PtrValueType<const void, Space>::type *;
448+
using pointer_t = typename detail::DecoratedType<const void, Space>::type *;
448449
using const_pointer_t =
449-
typename detail::PtrValueType<const void, Space>::type const *;
450+
typename detail::DecoratedType<const void, Space>::type const *;
450451

451452
static constexpr access::address_space address_space = Space;
452453

@@ -544,7 +545,7 @@ class multi_ptr<const void, Space> {
544545
template <typename ElementType>
545546
explicit operator multi_ptr<const ElementType, Space>() const {
546547
using elem_pointer_t =
547-
typename detail::PtrValueType<const ElementType, Space>::type *;
548+
typename detail::DecoratedType<const ElementType, Space>::type *;
548549
return multi_ptr<const ElementType, Space>(
549550
static_cast<elem_pointer_t>(m_Pointer));
550551
}

0 commit comments

Comments
 (0)