Skip to content

Commit 76bf2ed

Browse files
authored
[SYCL][CUDA] Fix event profiling queries (#2034)
Return the correct PI API error code when trying to query events for commands on queues that have not enabled profiling. Signed-off-by: Bjoern Knafla <[email protected]>
1 parent 296fa1a commit 76bf2ed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,6 +2848,11 @@ pi_result cuda_piEventGetProfilingInfo(pi_event event,
28482848

28492849
assert(event != nullptr);
28502850

2851+
pi_queue queue = event->get_queue();
2852+
if (queue == nullptr || !(queue->properties_ & PI_QUEUE_PROFILING_ENABLE)) {
2853+
return PI_PROFILING_INFO_NOT_AVAILABLE;
2854+
}
2855+
28512856
switch (param_name) {
28522857
case PI_PROFILING_INFO_COMMAND_QUEUED:
28532858
case PI_PROFILING_INFO_COMMAND_SUBMIT:

0 commit comments

Comments
 (0)