DPC++ Runtime
Runtime libraries for oneAPI DPC++
usm_pointers.hpp
Go to the documentation of this file.
1 //==-------- usm_pointers.hpp - Extended 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 
19 namespace ext {
20 namespace intel {
21 
22 template <typename ElementType,
23  access::decorated IsDecorated = access::decorated::legacy>
24 using device_ptr =
25  multi_ptr<ElementType, access::address_space::ext_intel_global_device_space,
26  IsDecorated>;
27 
28 template <typename ElementType,
29  access::decorated IsDecorated = access::decorated::legacy>
30 using host_ptr =
31  multi_ptr<ElementType, access::address_space::ext_intel_global_host_space,
32  IsDecorated>;
33 
34 // Template specialization aliases for different pointer address spaces.
35 // The interface exposes non-decorated pointer while keeping the
36 // address space information internally.
37 
38 template <typename ElementType>
39 using raw_device_ptr =
40  multi_ptr<ElementType, access::address_space::ext_intel_global_device_space,
41  access::decorated::no>;
42 
43 template <typename ElementType>
44 using raw_host_ptr =
45  multi_ptr<ElementType, access::address_space::ext_intel_global_host_space,
46  access::decorated::no>;
47 
48 // Template specialization aliases for different pointer address spaces.
49 // The interface exposes decorated pointer.
50 
51 template <typename ElementType>
53  multi_ptr<ElementType, access::address_space::ext_intel_global_device_space,
54  access::decorated::yes>;
55 
56 template <typename ElementType>
57 using decorated_host_ptr =
58  multi_ptr<ElementType, access::address_space::ext_intel_global_host_space,
59  access::decorated::yes>;
60 
61 } // namespace intel
62 } // namespace ext
63 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
64 } // namespace sycl
__SYCL_INLINE_VER_NAMESPACE
#define __SYCL_INLINE_VER_NAMESPACE(X)
Definition: defines_elementary.hpp:11
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
access.hpp
sycl::_V1::multi_ptr
Provides constructors for address space qualified and non address space qualified pointers to allow i...
Definition: atomic.hpp:34
sycl::_V1::ext::intel::device_ptr
multi_ptr< ElementType, access::address_space::ext_intel_global_device_space, IsDecorated > device_ptr
Definition: usm_pointers.hpp:26
sycl::_V1::access::decorated
decorated
Definition: access.hpp:59
sycl::_V1::Space
Space
Definition: multi_ptr.hpp:1307
sycl::_V1::access::address_space
address_space
Definition: access.hpp:47