forked from triSYCL/triSYCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default_classes.hpp
160 lines (117 loc) · 2.6 KB
/
default_classes.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#ifndef TRISYCL_SYCL_DETAIL_DEFAULT_CLASSES_HPP
#define TRISYCL_SYCL_DETAIL_DEFAULT_CLASSES_HPP
/** \file The OpenCL SYCL default classes to use from the STL according to
section 3.2 of SYCL 1.2 specification
Ronan at Keryell point FR
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
*/
/** \addtogroup defaults Manage default configuration and types
@{
*/
#ifndef CL_SYCL_NO_STD_VECTOR
/** The vector type to be used as SYCL vector
*/
#include <memory>
#include <vector>
namespace cl {
namespace sycl {
template <class T, class Alloc = std::allocator<T>>
using vector_class = std::vector<T, Alloc>;
}
}
#endif
#ifndef CL_SYCL_NO_STD_STRING
/** The string type to be used as SYCL string
*/
#include <string>
namespace cl {
namespace sycl {
using string_class = std::string;
}
}
#endif
#ifndef CL_SYCL_NO_STD_FUNCTION
/** The functional type to be used as SYCL function
*/
#include <functional>
namespace cl {
namespace sycl {
template <class R, class... ArgTypes>
using function_class = std::function<R(ArgTypes...)>;
}
}
#endif
#ifndef CL_SYCL_NO_STD_MUTEX
/** The mutex type to be used as SYCL mutex
*/
#include <mutex>
namespace cl {
namespace sycl {
using mutex_class = std::mutex;
}
}
#endif
#ifndef CL_SYCL_NO_STD_UNIQUE_PTR
/** The unique pointer type to be used as SYCL unique pointer
*/
#include <memory>
namespace cl {
namespace sycl {
template <class T, class D = std::default_delete<T>>
using unique_ptr_class = std::unique_ptr<T[], D>;
}
}
#endif
#ifndef CL_SYCL_NO_STD_SHARED_PTR
/** The shared pointer type to be used as SYCL shared pointer
*/
#include <memory>
namespace cl {
namespace sycl {
template <class T>
using shared_ptr_class = std::shared_ptr<T>;
}
}
#endif
#ifndef CL_SYCL_NO_STD_WEAK_PTR
/** The weak pointer type to be used as SYCL weak pointer
*/
#include <memory>
namespace cl {
namespace sycl {
template <class T>
using weak_ptr_class = std::weak_ptr<T>;
}
}
#endif
#ifndef CL_SYCL_NO_STD_HASH
/** The hash type to be used as SYCL hash
*/
#include <functional>
namespace cl {
namespace sycl {
template <class T>
using hash_class = std::hash<T>;
}
}
#endif
#ifndef CL_SYCL_NO_STD_EXCEPT
/** The exception pointer type to be used as SYCL exception pointer
*/
#include <exception>
namespace cl {
namespace sycl {
using exception_ptr_class = std::exception_ptr;
}
}
#endif
/// @} End the defaults Doxygen group
/*
# Some Emacs stuff:
### Local Variables:
### ispell-local-dictionary: "american"
### eval: (flyspell-prog-mode)
### End:
*/
#endif // TRISYCL_SYCL_DETAIL_DEFAULT_CLASSES_HPP