@@ -72,14 +72,22 @@ class buffer {
7272 using EnableIfSameNonConstIterators = typename detail::enable_if_t <
7373 std::is_same<ItA, ItB>::value && !std::is_const<ItA>::value, ItA>;
7474
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+
7581 buffer (const range<dimensions> &bufferRange,
7682 const property_list &propList = {},
7783 const detail::code_location CodeLoc = detail::code_location::current())
7884 : Range(bufferRange) {
7985 impl = std::make_shared<detail::buffer_impl>(
8086 size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)), propList,
8187 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 ());
8391 }
8492
8593 buffer (const range<dimensions> &bufferRange, AllocatorT allocator,
@@ -90,7 +98,9 @@ class buffer {
9098 size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)), propList,
9199 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
92100 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 ());
94104 }
95105
96106 buffer (T *hostData, const range<dimensions> &bufferRange,
@@ -101,7 +111,9 @@ class buffer {
101111 hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
102112 propList,
103113 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 ());
105117 }
106118
107119 buffer (T *hostData, const range<dimensions> &bufferRange,
@@ -113,7 +125,9 @@ class buffer {
113125 propList,
114126 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
115127 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 ());
117131 }
118132
119133 template <typename _T = T>
@@ -126,7 +140,9 @@ class buffer {
126140 hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
127141 propList,
128142 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 ());
130146 }
131147
132148 template <typename _T = T>
@@ -140,7 +156,9 @@ class buffer {
140156 propList,
141157 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
142158 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 ());
144162 }
145163
146164 buffer (const std::shared_ptr<T> &hostData,
@@ -153,7 +171,10 @@ class buffer {
153171 propList,
154172 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
155173 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 ());
157178 }
158179
159180 buffer (const std::shared_ptr<T[]> &hostData,
@@ -166,7 +187,10 @@ class buffer {
166187 propList,
167188 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
168189 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 ());
170194 }
171195
172196 buffer (const std::shared_ptr<T> &hostData,
@@ -178,7 +202,10 @@ class buffer {
178202 hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
179203 propList,
180204 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 ());
182209 }
183210
184211 buffer (const std::shared_ptr<T[]> &hostData,
@@ -190,7 +217,10 @@ class buffer {
190217 hostData, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
191218 propList,
192219 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 ());
194224 }
195225
196226 template <class InputIterator , int N = dimensions,
@@ -205,7 +235,9 @@ class buffer {
205235 propList,
206236 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
207237 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 });
209241 }
210242
211243 template <class InputIterator , int N = dimensions,
@@ -219,7 +251,10 @@ class buffer {
219251 first, last, size () * sizeof (T), detail::getNextPowerOfTwo (sizeof (T)),
220252 propList,
221253 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);
223258 }
224259
225260 // This constructor is a prototype for a future SYCL specification
@@ -235,7 +270,10 @@ class buffer {
235270 detail::getNextPowerOfTwo (sizeof (T)), propList,
236271 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(
237272 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);
239277 }
240278
241279 // This constructor is a prototype for a future SYCL specification
@@ -252,7 +290,9 @@ class buffer {
252290 : impl(b.impl), Range(subRange),
253291 OffsetInBytes (getOffsetInBytes<T>(baseIndex, b.Range)),
254292 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 ());
256296
257297 if (b.is_sub_buffer ())
258298 throw cl::sycl::invalid_object_error (
@@ -281,22 +321,28 @@ class buffer {
281321 detail::pi::cast<pi_native_handle>(MemObject), SyclContext, BufSize,
282322 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(),
283323 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 ());
285327 }
286328#endif
287329
288330 buffer (const buffer &rhs,
289331 const detail::code_location CodeLoc = detail::code_location::current())
290332 : impl(rhs.impl), Range(rhs.Range), OffsetInBytes(rhs.OffsetInBytes),
291333 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 ());
293337 }
294338
295339 buffer (buffer &&rhs,
296340 const detail::code_location CodeLoc = detail::code_location::current())
297341 : impl(std::move(rhs.impl)), Range(rhs.Range),
298342 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 ());
300346 }
301347
302348 buffer &operator =(const buffer &rhs) = default ;
@@ -485,7 +531,9 @@ class buffer {
485531 MemObject, SyclContext, BufSize,
486532 make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT>>(),
487533 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 ());
489537 }
490538
491539 // Reinterpret contructor
@@ -495,7 +543,9 @@ class buffer {
495543 const detail::code_location CodeLoc = detail::code_location::current())
496544 : impl(Impl), Range(reinterpretRange), OffsetInBytes(reinterpretOffset),
497545 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 ());
499549 }
500550
501551 template <typename Type, int N>
0 commit comments