10
10
11
11
#include < utility> // for std::forward
12
12
13
+ #include < sycl/detail/common.hpp>
13
14
#include < sycl/event.hpp>
14
15
#include < sycl/ext/oneapi/properties/properties.hpp>
15
16
#include < sycl/handler.hpp>
@@ -74,14 +75,18 @@ template <typename LCRangeT, typename LCPropertiesT> struct LaunchConfigAccess {
74
75
} // namespace detail
75
76
76
77
template <typename CommandGroupFunc>
77
- void submit (queue Q, CommandGroupFunc &&CGF) {
78
+ void submit (queue Q, CommandGroupFunc &&CGF,
79
+ const sycl::detail::code_location &CodeLoc =
80
+ sycl::detail::code_location::current ()) {
78
81
// TODO: Use new submit without Events.
79
- Q.submit (std::forward<CommandGroupFunc>(CGF));
82
+ Q.submit (std::forward<CommandGroupFunc>(CGF), CodeLoc );
80
83
}
81
84
82
85
template <typename CommandGroupFunc>
83
- event submit_with_event (queue Q, CommandGroupFunc &&CGF) {
84
- return Q.submit (std::forward<CommandGroupFunc>(CGF));
86
+ event submit_with_event (queue Q, CommandGroupFunc &&CGF,
87
+ const sycl::detail::code_location &CodeLoc =
88
+ sycl::detail::code_location::current ()) {
89
+ return Q.submit (std::forward<CommandGroupFunc>(CGF), CodeLoc);
85
90
}
86
91
87
92
template <typename KernelName = sycl::detail::auto_name, typename KernelType>
@@ -90,8 +95,12 @@ void single_task(handler &CGH, const KernelType &KernelObj) {
90
95
}
91
96
92
97
template <typename KernelName = sycl::detail::auto_name, typename KernelType>
93
- void single_task (queue Q, const KernelType &KernelObj) {
94
- submit (Q, [&](handler &CGH) { single_task<KernelName>(CGH, KernelObj); });
98
+ void single_task (queue Q, const KernelType &KernelObj,
99
+ const sycl::detail::code_location &CodeLoc =
100
+ sycl::detail::code_location::current ()) {
101
+ submit (
102
+ Q, [&](handler &CGH) { single_task<KernelName>(CGH, KernelObj); },
103
+ CodeLoc);
95
104
}
96
105
97
106
template <typename ... ArgsT>
@@ -261,25 +270,32 @@ inline void memcpy(handler &CGH, void *Dest, const void *Src, size_t NumBytes) {
261
270
CGH.memcpy (Dest, Src, NumBytes);
262
271
}
263
272
264
- inline void memcpy (queue Q, void *Dest, const void *Src, size_t NumBytes) {
265
- submit (Q, [&](handler &CGH) { memcpy (CGH, Dest, Src, NumBytes); });
273
+ inline void memcpy (queue Q, void *Dest, const void *Src, size_t NumBytes,
274
+ const sycl::detail::code_location &CodeLoc =
275
+ sycl::detail::code_location::current ()) {
276
+ submit (Q, [&](handler &CGH) { memcpy (CGH, Dest, Src, NumBytes); }, CodeLoc);
266
277
}
267
278
268
279
template <typename T>
269
280
void copy (handler &CGH, const T *Src, T *Dest, size_t Count) {
270
281
CGH.copy <T>(Src, Dest, Count);
271
282
}
272
283
273
- template <typename T> void copy (queue Q, const T *Src, T *Dest, size_t Count) {
274
- submit (Q, [&](handler &CGH) { copy<T>(CGH, Src, Dest, Count); });
284
+ template <typename T>
285
+ void copy (queue Q, const T *Src, T *Dest, size_t Count,
286
+ const sycl::detail::code_location &CodeLoc =
287
+ sycl::detail::code_location::current ()) {
288
+ submit (Q, [&](handler &CGH) { copy<T>(CGH, Src, Dest, Count); }, CodeLoc);
275
289
}
276
290
277
291
inline void memset (handler &CGH, void *Ptr, int Value, size_t NumBytes) {
278
292
CGH.memset (Ptr, Value, NumBytes);
279
293
}
280
294
281
- inline void memset (queue Q, void *Ptr, int Value, size_t NumBytes) {
282
- submit (Q, [&](handler &CGH) { memset (CGH, Ptr, Value, NumBytes); });
295
+ inline void memset (queue Q, void *Ptr, int Value, size_t NumBytes,
296
+ const sycl::detail::code_location &CodeLoc =
297
+ sycl::detail::code_location::current ()) {
298
+ submit (Q, [&](handler &CGH) { memset (CGH, Ptr, Value, NumBytes); }, CodeLoc);
283
299
}
284
300
285
301
template <typename T>
@@ -288,38 +304,49 @@ void fill(sycl::handler &CGH, T *Ptr, const T &Pattern, size_t Count) {
288
304
}
289
305
290
306
template <typename T>
291
- void fill (sycl::queue Q, T *Ptr, const T &Pattern, size_t Count) {
292
- submit (Q, [&](handler &CGH) { fill<T>(CGH, Ptr, Pattern, Count); });
307
+ void fill (sycl::queue Q, T *Ptr, const T &Pattern, size_t Count,
308
+ const sycl::detail::code_location &CodeLoc =
309
+ sycl::detail::code_location::current ()) {
310
+ submit (Q, [&](handler &CGH) { fill<T>(CGH, Ptr, Pattern, Count); }, CodeLoc);
293
311
}
294
312
295
313
inline void prefetch (handler &CGH, void *Ptr, size_t NumBytes) {
296
314
CGH.prefetch (Ptr, NumBytes);
297
315
}
298
316
299
- inline void prefetch (queue Q, void *Ptr, size_t NumBytes) {
300
- submit (Q, [&](handler &CGH) { prefetch (CGH, Ptr, NumBytes); });
317
+ inline void prefetch (queue Q, void *Ptr, size_t NumBytes,
318
+ const sycl::detail::code_location &CodeLoc =
319
+ sycl::detail::code_location::current ()) {
320
+ submit (Q, [&](handler &CGH) { prefetch (CGH, Ptr, NumBytes); }, CodeLoc);
301
321
}
302
322
303
323
inline void mem_advise (handler &CGH, void *Ptr, size_t NumBytes, int Advice) {
304
324
CGH.mem_advise (Ptr, NumBytes, Advice);
305
325
}
306
326
307
- inline void mem_advise (queue Q, void *Ptr, size_t NumBytes, int Advice) {
308
- submit (Q, [&](handler &CGH) { mem_advise (CGH, Ptr, NumBytes, Advice); });
327
+ inline void mem_advise (queue Q, void *Ptr, size_t NumBytes, int Advice,
328
+ const sycl::detail::code_location &CodeLoc =
329
+ sycl::detail::code_location::current ()) {
330
+ submit (
331
+ Q, [&](handler &CGH) { mem_advise (CGH, Ptr, NumBytes, Advice); },
332
+ CodeLoc);
309
333
}
310
334
311
335
inline void barrier (handler &CGH) { CGH.ext_oneapi_barrier (); }
312
336
313
- inline void barrier (queue Q) {
314
- submit (Q, [&](handler &CGH) { barrier (CGH); });
337
+ inline void barrier (queue Q, const sycl::detail::code_location &CodeLoc =
338
+ sycl::detail::code_location::current ()) {
339
+ submit (Q, [&](handler &CGH) { barrier (CGH); }, CodeLoc);
315
340
}
316
341
317
342
inline void partial_barrier (handler &CGH, const std::vector<event> &Events) {
318
343
CGH.ext_oneapi_barrier (Events);
319
344
}
320
345
321
- inline void partial_barrier (queue Q, const std::vector<event> &Events) {
322
- submit (Q, [&](handler &CGH) { partial_barrier (CGH, Events); });
346
+ inline void partial_barrier (queue Q, const std::vector<event> &Events,
347
+ const sycl::detail::code_location &CodeLoc =
348
+ sycl::detail::code_location::current ()) {
349
+ submit (Q, [&](handler &CGH) { partial_barrier (CGH, Events); }, CodeLoc);
323
350
}
324
351
325
352
} // namespace ext::oneapi::experimental
0 commit comments