Skip to content

Commit 64c1270

Browse files
authored
[SYCL] Fix build when DISABLE_SYCL_INSTRUMENTATION_METADATA is defined (#3372)
Signed-off-by: Sergey Kanaev <[email protected]>
1 parent c53a5f9 commit 64c1270

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

sycl/include/CL/sycl/queue.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,11 @@ class __SYCL_EXPORT queue {
233233
const detail::code_location &CodeLoc = detail::code_location::current()
234234
#endif
235235
) {
236-
#ifdef DISABLE_SYCL_INSTRUMENTATION_METADATA
237-
const detail::code_location &CodeLoc = {};
236+
return submit([=](handler &CGH) { CGH.barrier(); }
237+
#ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
238+
, CodeLoc
238239
#endif
239-
return submit([=](handler &CGH) { CGH.barrier(); }, CodeLoc);
240+
);
240241
}
241242

242243
/// Prevents any commands submitted afterward to this queue from executing
@@ -255,10 +256,11 @@ class __SYCL_EXPORT queue {
255256
const detail::code_location &CodeLoc = detail::code_location::current()
256257
#endif
257258
) {
258-
#ifdef DISABLE_SYCL_INSTRUMENTATION_METADATA
259-
const detail::code_location &CodeLoc = {};
259+
return submit([=](handler &CGH) { CGH.barrier(WaitList); }
260+
#ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
261+
, CodeLoc
260262
#endif
261-
return submit([=](handler &CGH) { CGH.barrier(WaitList); }, CodeLoc);
263+
);
262264
}
263265

264266
/// Performs a blocking wait for the completion of all enqueued tasks in the

0 commit comments

Comments
 (0)