@@ -72,14 +72,22 @@ class buffer {
72
72
using EnableIfSameNonConstIterators = typename detail::enable_if_t <
73
73
std::is_same<ItA, ItB>::value && !std::is_const<ItA>::value, ItA>;
74
74
75
+ std::array<size_t , 3 > rangeToArray (range<3 > &r) { return {r[0 ], r[1 ], r[2 ]}; }
76
+
77
+ std::array<size_t , 3 > rangeToArray (range<2 > &r) { return {r[0 ], r[1 ], 0 }; }
78
+
79
+ std::array<size_t , 3 > rangeToArray (range<1 > &r) { return {r[0 ], 0 , 0 }; }
80
+
75
81
buffer (const range<dimensions> &bufferRange,
76
82
const property_list &propList = {},
77
83
const detail::code_location CodeLoc = detail::code_location::current())
78
84
: Range(bufferRange) {
79
85
impl = std::make_shared<detail::buffer_impl>(
80
86
size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)), propList,
81
87
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
82
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
88
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), nullptr ,
89
+ (const void *)typeid (T).name (), dimensions,
90
+ sizeof (T), rangeToArray (Range).data ());
83
91
}
84
92
85
93
buffer (const range<dimensions> &bufferRange, AllocatorT allocator,
@@ -90,7 +98,9 @@ class buffer {
90
98
size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)), propList,
91
99
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
92
100
allocator));
93
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
101
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), nullptr ,
102
+ (const void *)typeid (T).name (), dimensions,
103
+ sizeof (T), rangeToArray (Range).data ());
94
104
}
95
105
96
106
buffer (T *hostData, const range<dimensions> &bufferRange,
@@ -101,7 +111,9 @@ class buffer {
101
111
hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
102
112
propList,
103
113
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
104
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
114
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), hostData,
115
+ (const void *)typeid (T).name (), dimensions,
116
+ sizeof (T), rangeToArray (Range).data ());
105
117
}
106
118
107
119
buffer (T *hostData, const range<dimensions> &bufferRange,
@@ -113,7 +125,9 @@ class buffer {
113
125
propList,
114
126
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
115
127
allocator));
116
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
128
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), hostData,
129
+ (const void *)typeid (T).name (), dimensions,
130
+ sizeof (T), rangeToArray (Range).data ());
117
131
}
118
132
119
133
template <typename _T = T>
@@ -126,7 +140,9 @@ class buffer {
126
140
hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
127
141
propList,
128
142
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
129
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
143
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), hostData,
144
+ (const void *)typeid (T).name (), dimensions,
145
+ sizeof (T), rangeToArray (Range).data ());
130
146
}
131
147
132
148
template <typename _T = T>
@@ -140,7 +156,9 @@ class buffer {
140
156
propList,
141
157
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
142
158
allocator));
143
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
159
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), hostData,
160
+ (const void *)typeid (T).name (), dimensions,
161
+ sizeof (T), rangeToArray (Range).data ());
144
162
}
145
163
146
164
buffer (const std::shared_ptr<T> &hostData,
@@ -153,7 +171,10 @@ class buffer {
153
171
propList,
154
172
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
155
173
allocator));
156
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
174
+ impl->constructorNotification (CodeLoc, (void *)impl.get (),
175
+ (void *)hostData.get (),
176
+ (const void *)typeid (T).name (), dimensions,
177
+ sizeof (T), rangeToArray (Range).data ());
157
178
}
158
179
159
180
buffer (const std::shared_ptr<T[]> &hostData,
@@ -166,7 +187,10 @@ class buffer {
166
187
propList,
167
188
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
168
189
allocator));
169
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
190
+ impl->constructorNotification (CodeLoc, (void *)impl.get (),
191
+ (void *)hostData.get (),
192
+ (const void *)typeid (T).name (), dimensions,
193
+ sizeof (T), rangeToArray (Range).data ());
170
194
}
171
195
172
196
buffer (const std::shared_ptr<T> &hostData,
@@ -178,7 +202,10 @@ class buffer {
178
202
hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
179
203
propList,
180
204
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
181
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
205
+ impl->constructorNotification (CodeLoc, (void *)impl.get (),
206
+ (void *)hostData.get (),
207
+ (const void *)typeid (T).name (), dimensions,
208
+ sizeof (T), rangeToArray (Range).data ());
182
209
}
183
210
184
211
buffer (const std::shared_ptr<T[]> &hostData,
@@ -190,7 +217,10 @@ class buffer {
190
217
hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
191
218
propList,
192
219
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
193
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
220
+ impl->constructorNotification (CodeLoc, (void *)impl.get (),
221
+ (void *)hostData.get (),
222
+ (const void *)typeid (T).name (), dimensions,
223
+ sizeof (T), rangeToArray (Range).data ());
194
224
}
195
225
196
226
template <class InputIterator , int N = dimensions,
@@ -205,7 +235,9 @@ class buffer {
205
235
propList,
206
236
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
207
237
allocator));
208
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
238
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), &*first,
239
+ (const void *)typeid (T).name (), dimensions,
240
+ sizeof (T), {Range[0 ], 0 , 0 });
209
241
}
210
242
211
243
template <class InputIterator , int N = dimensions,
@@ -219,7 +251,10 @@ class buffer {
219
251
first, last, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
220
252
propList,
221
253
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>());
222
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
254
+ size_t r[3 ] = {Range[0 ], 0 , 0 };
255
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), &*first,
256
+ (const void *)typeid (T).name (), dimensions,
257
+ sizeof (T), r);
223
258
}
224
259
225
260
// This constructor is a prototype for a future SYCL specification
@@ -235,7 +270,10 @@ class buffer {
235
270
detail::getNextPowerOfTwo (sizeof (T)), propList,
236
271
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
237
272
allocator));
238
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
273
+ size_t r[3 ] = {Range[0 ], 0 , 0 };
274
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), container.data (),
275
+ (const void *)typeid (T).name (), dimensions,
276
+ sizeof (T), r);
239
277
}
240
278
241
279
// This constructor is a prototype for a future SYCL specification
@@ -252,7 +290,9 @@ class buffer {
252
290
: impl(b.impl), Range(subRange),
253
291
OffsetInBytes (getOffsetInBytes<T>(baseIndex, b.Range)),
254
292
IsSubBuffer(true ) {
255
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
293
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), impl.get (),
294
+ (const void *)typeid (T).name (), dimensions,
295
+ sizeof (T), rangeToArray (Range).data ());
256
296
257
297
if (b.is_sub_buffer ())
258
298
throw cl::sycl::invalid_object_error (
@@ -281,22 +321,28 @@ class buffer {
281
321
detail::pi ::cast<pi_native_handle>(MemObject), SyclContext, BufSize,
282
322
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(),
283
323
AvailableEvent);
284
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
324
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), &MemObject,
325
+ (const void *)typeid (T).name (), dimensions,
326
+ sizeof (T), rangeToArray (Range).data ());
285
327
}
286
328
#endif
287
329
288
330
buffer (const buffer &rhs,
289
331
const detail::code_location CodeLoc = detail::code_location::current())
290
332
: impl(rhs.impl), Range(rhs.Range), OffsetInBytes(rhs.OffsetInBytes),
291
333
IsSubBuffer(rhs.IsSubBuffer) {
292
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
334
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), impl.get (),
335
+ (const void *)typeid (T).name (), dimensions,
336
+ sizeof (T), rangeToArray (Range).data ());
293
337
}
294
338
295
339
buffer (buffer &&rhs,
296
340
const detail::code_location CodeLoc = detail::code_location::current())
297
341
: impl(std::move(rhs.impl)), Range(rhs.Range),
298
342
OffsetInBytes(rhs.OffsetInBytes), IsSubBuffer(rhs.IsSubBuffer) {
299
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
343
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), impl.get (),
344
+ (const void *)typeid (T).name (), dimensions,
345
+ sizeof (T), rangeToArray (Range).data ());
300
346
}
301
347
302
348
buffer &operator =(const buffer &rhs) = default ;
@@ -485,7 +531,9 @@ class buffer {
485
531
MemObject, SyclContext, BufSize,
486
532
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(),
487
533
AvailableEvent);
488
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
534
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), &MemObject,
535
+ (const void *)typeid (T).name (), dimensions,
536
+ sizeof (T), rangeToArray (Range).data ());
489
537
}
490
538
491
539
// Reinterpret contructor
@@ -495,7 +543,9 @@ class buffer {
495
543
const detail::code_location CodeLoc = detail::code_location::current())
496
544
: impl(Impl), Range(reinterpretRange), OffsetInBytes(reinterpretOffset),
497
545
IsSubBuffer (isSubBuffer) {
498
- impl->constructorNotification (CodeLoc, (void *)impl.get ());
546
+ impl->constructorNotification (CodeLoc, (void *)impl.get (), Impl.get (),
547
+ (const void *)typeid (T).name (), dimensions,
548
+ sizeof (T), rangeToArray (Range).data ());
499
549
}
500
550
501
551
template <typename Type, int N>
0 commit comments