35
35
// or : const detail::code_location &CodeLoc = {}
36
36
37
37
#ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
38
+ #define _CODELOCONLYPARAM (a ) \
39
+ const detail::code_location a = detail::code_location::current()
38
40
#define _CODELOCPARAM (a ) \
39
41
, const detail::code_location a = detail::code_location::current()
40
42
@@ -246,7 +248,7 @@ class __SYCL_EXPORT queue {
246
248
// / \param CodeLoc is the code location of the submit call (default argument)
247
249
// / \return a SYCL event object, which corresponds to the queue the command
248
250
// / group is being enqueued on.
249
- event submit_barrier (_CODELOCPARAM (&CodeLoc)) {
251
+ event submit_barrier (_CODELOCONLYPARAM (&CodeLoc)) {
250
252
return submit ([=](handler &CGH) { CGH.barrier (); } _CODELOCFW (CodeLoc));
251
253
}
252
254
@@ -270,7 +272,7 @@ class __SYCL_EXPORT queue {
270
272
// /
271
273
// / Synchronous errors will be reported through SYCL exceptions.
272
274
// / @param CodeLoc is the code location of the submit call (default argument)
273
- void wait (_CODELOCPARAM (&CodeLoc)) {
275
+ void wait (_CODELOCONLYPARAM (&CodeLoc)) {
274
276
_CODELOCARG (&CodeLoc)
275
277
276
278
wait_proxy (CodeLoc);
@@ -284,7 +286,7 @@ class __SYCL_EXPORT queue {
284
286
// / construction. If no async_handler was provided then asynchronous
285
287
// / exceptions will be lost.
286
288
// / @param CodeLoc is the code location of the submit call (default argument)
287
- void wait_and_throw (_CODELOCPARAM (&CodeLoc)) {
289
+ void wait_and_throw (_CODELOCONLYPARAM (&CodeLoc)) {
288
290
_CODELOCARG (&CodeLoc);
289
291
290
292
wait_and_throw_proxy (CodeLoc);
@@ -706,6 +708,7 @@ class __SYCL_EXPORT queue {
706
708
707
709
// Clean up CODELOC and KERNELFUNC macros.
708
710
#undef _CODELOCPARAM
711
+ #undef _CODELOCONLYPARAM
709
712
#undef _CODELOCARG
710
713
#undef _CODELOCFW
711
714
#undef _KERNELFUNCPARAM
0 commit comments