15
15
#include < sycl/sycl.hpp>
16
16
17
17
namespace Catch {
18
- template <>
19
- struct StringMaker <sycl::access_mode> {
20
- using type = sycl::access_mode;
21
- static std::string convert (type value) {
22
- switch (value) {
23
- case type::read:
24
- return " access_mode::read" ;
25
- case type::write:
26
- return " access_mode::write" ;
27
- case type::read_write:
28
- return " access_mode::read_write" ;
29
- case type::discard_write:
30
- return " access_mode::discard_write (deprecated)" ;
31
- case type::discard_read_write:
32
- return " access_mode::discard_read_write (deprecated)" ;
33
- case type::atomic:
34
- return " access_mode::atomic (deprecated)" ;
35
- default :
36
- return " unknown access mode" ;
37
- }
38
- }
39
- };
40
-
41
18
template <int Dimensions>
42
19
struct StringMaker <sycl::id<Dimensions>> {
43
20
static std::string convert (const sycl::id<Dimensions>& id) {
@@ -53,163 +30,6 @@ struct StringMaker<sycl::id<Dimensions>> {
53
30
return ss.str ();
54
31
}
55
32
};
56
-
57
- template <>
58
- struct StringMaker <sycl::target> {
59
- using type = sycl::target;
60
- static std::string convert (type value) {
61
- switch (value) {
62
- case type::device:
63
- return " target::device" ;
64
- // FIXME: re-enable when target::host_task is implemented
65
- #if !SYCL_CTS_COMPILING_WITH_ADAPTIVECPP
66
- case type::host_task:
67
- return " target::host_task" ;
68
- #endif
69
-
70
- case type::constant_buffer:
71
- return " target::constant_buffer (deprecated)" ;
72
- case type::local:
73
- return " target::local (deprecated)" ;
74
- case type::host_buffer:
75
- return " target::host_buffer (deprecated)" ;
76
- default :
77
- return " unknown target" ;
78
- }
79
- }
80
- };
81
-
82
- template <>
83
- struct StringMaker <sycl::aspect> {
84
- using type = sycl::aspect;
85
- static std::string convert (type value) {
86
- switch (value) {
87
- case type::cpu:
88
- return " aspect::cpu" ;
89
- case type::gpu:
90
- return " aspect::gpu" ;
91
- case type::accelerator:
92
- return " aspect::accelerator" ;
93
- case type::custom:
94
- return " aspect::custom" ;
95
- case type::emulated:
96
- return " aspect::emulated" ;
97
- case type::host_debuggable:
98
- return " aspect::host_debuggable" ;
99
- case type::fp16:
100
- return " aspect::fp16" ;
101
- case type::fp64:
102
- return " aspect::fp64" ;
103
- case type::atomic64:
104
- return " aspect::atomic64" ;
105
- case type::image:
106
- return " aspect::image" ;
107
- case type::online_compiler:
108
- return " aspect::online_compiler" ;
109
- case type::online_linker:
110
- return " aspect::online_linker" ;
111
- case type::queue_profiling:
112
- return " aspect::queue_profiling" ;
113
- case type::usm_device_allocations:
114
- return " aspect::usm_device_allocations" ;
115
- case type::usm_host_allocations:
116
- return " aspect::usm_host_allocations" ;
117
- case type::usm_atomic_host_allocations:
118
- return " aspect::usm_atomic_host_allocations" ;
119
- case type::usm_shared_allocations:
120
- return " aspect::usm_shared_allocations" ;
121
- case type::usm_atomic_shared_allocations:
122
- return " aspect::usm_atomic_shared_allocations" ;
123
- case type::usm_system_allocations:
124
- return " aspect::usm_system_allocations" ;
125
- default :
126
- return " unknown aspect" ;
127
- }
128
- }
129
- };
130
-
131
- template <>
132
- struct StringMaker <sycl::memory_order> {
133
- using type = sycl::memory_order;
134
- static std::string convert (const type& order) {
135
- switch (order) {
136
- case type::relaxed:
137
- return " memory_order::relaxed" ;
138
- case type::acq_rel:
139
- return " memory_order::acq_rel" ;
140
- case type::seq_cst:
141
- return " memory_order::seq_cst" ;
142
- case type::acquire:
143
- return " memory_order::acquire" ;
144
- case type::release:
145
- return " memory_order::release" ;
146
- default :
147
- return " unknown memory_order" ;
148
- }
149
- }
150
- };
151
-
152
- template <>
153
- struct StringMaker <sycl::memory_scope> {
154
- using type = sycl::memory_scope;
155
- static std::string convert (const type& scope) {
156
- switch (scope) {
157
- case type::work_item:
158
- return " memory_scope::work_item" ;
159
- case type::sub_group:
160
- return " memory_scope::sub_group" ;
161
- case type::work_group:
162
- return " memory_scope::work_group" ;
163
- case type::device:
164
- return " memory_scope::device" ;
165
- case type::system:
166
- return " memory_scope::system" ;
167
- default :
168
- return " unknown memory_scope" ;
169
- }
170
- }
171
- };
172
-
173
- template <>
174
- struct StringMaker <sycl::access::address_space> {
175
- using type = sycl::access::address_space;
176
- static std::string convert (const type& addr_space) {
177
- switch (addr_space) {
178
- case type::global_space:
179
- return " address_space::global_space" ;
180
- case type::local_space:
181
- return " address_space::local_space" ;
182
- case type::generic_space:
183
- return " address_space::generic_space" ;
184
- case type::private_space:
185
- return " address_space::private_space" ;
186
- default :
187
- // no stringification for deprecated ones
188
- return " unknown or deprecated address_space" ;
189
- }
190
- }
191
- };
192
-
193
- // FIXME: re-enable when sycl::access::decorated is implemented in adaptivecpp
194
- #if !SYCL_CTS_COMPILING_WITH_ADAPTIVECPP
195
- template <>
196
- struct StringMaker <sycl::access::decorated> {
197
- using type = sycl::access::decorated;
198
- static std::string convert (type value) {
199
- switch (value) {
200
- case type::yes:
201
- return " access::decorated::yes" ;
202
- case type::no:
203
- return " access::decorated::no" ;
204
- case type::legacy:
205
- return " access::decorated::legacy" ;
206
- default :
207
- return " unknown" ;
208
- }
209
- }
210
- };
211
- #endif
212
-
213
33
} // namespace Catch
214
34
215
35
#endif // __SYCLCTS_TESTS_COMMON_STRING_MAKERS_H
0 commit comments