File tree 2 files changed +17
-7
lines changed
2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,10 @@ event_impl::get_profiling_info<info::event_profiling::command_start>() {
348
348
return get_event_profiling_info<info::event_profiling::command_start>(
349
349
Handle , this ->getAdapter ());
350
350
}
351
- return 0 ;
351
+ // If command is nop (for example, USM operations for 0 bytes) return
352
+ // recorded submission time. If event is created using default constructor,
353
+ // 0 will be returned.
354
+ return MSubmitTime;
352
355
}
353
356
if (!MHostProfilingInfo)
354
357
throw sycl::exception (
@@ -367,7 +370,10 @@ uint64_t event_impl::get_profiling_info<info::event_profiling::command_end>() {
367
370
return get_event_profiling_info<info::event_profiling::command_end>(
368
371
Handle , this ->getAdapter ());
369
372
}
370
- return 0 ;
373
+ // If command is nop (for example, USM operations for 0 bytes) return
374
+ // recorded submission time. If event is created using default constructor,
375
+ // 0 will be returned.
376
+ return MSubmitTime;
371
377
}
372
378
if (!MHostProfilingInfo)
373
379
throw sycl::exception (
Original file line number Diff line number Diff line change @@ -19,9 +19,13 @@ int main() {
19
19
assert (e.get_info <info::event::command_execution_status>() ==
20
20
info::event_command_status::complete);
21
21
assert (e.get_info <info::event::reference_count>() == 0 );
22
- assert (e.get_profiling_info <sycl::info::event_profiling::command_submit>() ==
23
- 0 );
24
- assert (e.get_profiling_info <sycl::info::event_profiling::command_start>() ==
25
- 0 );
26
- assert (e.get_profiling_info <sycl::info::event_profiling::command_end>() == 0 );
22
+ auto submit_time =
23
+ e.get_profiling_info <sycl::info::event_profiling::command_submit>();
24
+ auto start_time =
25
+ e.get_profiling_info <sycl::info::event_profiling::command_start>();
26
+ auto end_time =
27
+ e.get_profiling_info <sycl::info::event_profiling::command_end>();
28
+
29
+ assert (submit_time == start_time);
30
+ assert (start_time == end_time);
27
31
}
You can’t perform that action at this time.
0 commit comments