DPC++ Runtime
Runtime libraries for oneAPI DPC++
pointers.hpp
Go to the documentation of this file.
1 //==------------ pointers.hpp - SYCL pointers classes ----------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 #include <sycl/access/access.hpp>
11 
12 namespace sycl {
14 
15 template <typename ElementType, access::address_space Space,
16  access::decorated DecorateAddress>
17 class multi_ptr;
18 // Template specialization aliases for different pointer address spaces
19 
20 template <typename ElementType,
21  access::decorated IsDecorated = access::decorated::legacy>
22 using generic_ptr =
24 
25 template <typename ElementType,
26  access::decorated IsDecorated = access::decorated::legacy>
27 using global_ptr =
29 
30 template <typename ElementType,
31  access::decorated IsDecorated = access::decorated::legacy>
32 using device_ptr =
33  multi_ptr<ElementType, access::address_space::ext_intel_global_device_space,
34  IsDecorated>;
35 
36 template <typename ElementType,
37  access::decorated IsDecorated = access::decorated::legacy>
38 using host_ptr =
39  multi_ptr<ElementType, access::address_space::ext_intel_global_host_space,
40  IsDecorated>;
41 
42 template <typename ElementType,
43  access::decorated IsDecorated = access::decorated::legacy>
44 using local_ptr =
46 
47 template <typename ElementType>
48 using constant_ptr =
49  multi_ptr<ElementType, access::address_space::constant_space,
50  access::decorated::legacy>;
51 
52 template <typename ElementType,
53  access::decorated IsDecorated = access::decorated::legacy>
54 using private_ptr =
56 
57 // Template specialization aliases for different pointer address spaces.
58 // The interface exposes non-decorated pointer while keeping the
59 // address space information internally.
60 
61 template <typename ElementType>
63  multi_ptr<ElementType, access::address_space::global_space,
64  access::decorated::no>;
65 
66 template <typename ElementType>
67 using raw_local_ptr = multi_ptr<ElementType, access::address_space::local_space,
68  access::decorated::no>;
69 
70 template <typename ElementType>
72  multi_ptr<ElementType, access::address_space::private_space,
73  access::decorated::no>;
74 
75 // Template specialization aliases for different pointer address spaces.
76 // The interface exposes decorated pointer.
77 
78 template <typename ElementType>
80  multi_ptr<ElementType, access::address_space::global_space,
81  access::decorated::yes>;
82 
83 template <typename ElementType>
85  multi_ptr<ElementType, access::address_space::local_space,
86  access::decorated::yes>;
87 
88 template <typename ElementType>
90  multi_ptr<ElementType, access::address_space::private_space,
91  access::decorated::yes>;
92 
93 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
94 } // namespace sycl
Provides constructors for address space qualified and non address space qualified pointers to allow i...
Definition: multi_ptr.hpp:78
#define __SYCL_INLINE_VER_NAMESPACE(X)
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14