@@ -160,9 +160,7 @@ event_impl::event_impl(ur_event_handle_t Event, const context &SyclContext)
160
160
}
161
161
162
162
event_impl::event_impl (const QueueImplPtr &Queue)
163
- : MQueue{Queue}, MIsProfilingEnabled{!Queue || Queue->MIsProfilingEnabled },
164
- MFallbackProfiling{MIsProfilingEnabled && Queue &&
165
- Queue->isProfilingFallback ()} {
163
+ : MQueue{Queue}, MIsProfilingEnabled{!Queue || Queue->MIsProfilingEnabled } {
166
164
if (Queue)
167
165
this ->setContextImpl (Queue->getContextImplPtr ());
168
166
else {
@@ -181,7 +179,6 @@ event_impl::event_impl(const QueueImplPtr &Queue)
181
179
void event_impl::setQueue (const QueueImplPtr &Queue) {
182
180
MQueue = Queue;
183
181
MIsProfilingEnabled = Queue->MIsProfilingEnabled ;
184
- MFallbackProfiling = MIsProfilingEnabled && Queue->isProfilingFallback ();
185
182
186
183
// TODO After setting the queue, the event is no longer default
187
184
// constructed. Consider a design change which would allow
@@ -348,17 +345,8 @@ event_impl::get_profiling_info<info::event_profiling::command_start>() {
348
345
if (!MIsHostEvent) {
349
346
auto Handle = getHandle ();
350
347
if (Handle) {
351
- auto StartTime =
352
- get_event_profiling_info<info::event_profiling::command_start>(
353
- Handle, this ->getAdapter ());
354
- if (!MFallbackProfiling) {
355
- return StartTime;
356
- } else {
357
- auto DeviceBaseTime =
358
- get_event_profiling_info<info::event_profiling::command_submit>(
359
- Handle, this ->getAdapter ());
360
- return MHostBaseTime - DeviceBaseTime + StartTime;
361
- }
348
+ return get_event_profiling_info<info::event_profiling::command_start>(
349
+ Handle, this ->getAdapter ());
362
350
}
363
351
return 0 ;
364
352
}
@@ -376,17 +364,8 @@ uint64_t event_impl::get_profiling_info<info::event_profiling::command_end>() {
376
364
if (!MIsHostEvent) {
377
365
auto Handle = this ->getHandle ();
378
366
if (Handle) {
379
- auto EndTime =
380
- get_event_profiling_info<info::event_profiling::command_end>(
381
- Handle, this ->getAdapter ());
382
- if (!MFallbackProfiling) {
383
- return EndTime;
384
- } else {
385
- auto DeviceBaseTime =
386
- get_event_profiling_info<info::event_profiling::command_submit>(
387
- Handle, this ->getAdapter ());
388
- return MHostBaseTime - DeviceBaseTime + EndTime;
389
- }
367
+ return get_event_profiling_info<info::event_profiling::command_end>(
368
+ Handle, this ->getAdapter ());
390
369
}
391
370
return 0 ;
392
371
}
@@ -587,40 +566,27 @@ void event_impl::cleanDepEventsThroughOneLevel() {
587
566
void event_impl::setSubmissionTime () {
588
567
if (!MIsProfilingEnabled && !MProfilingTagEvent)
589
568
return ;
590
- if (!MFallbackProfiling) {
591
- if (QueueImplPtr Queue = MQueue.lock ()) {
592
- try {
593
- MSubmitTime = Queue->getDeviceImpl ().getCurrentDeviceTime ();
594
- } catch (sycl::exception &e) {
595
- if (e.code () == sycl::errc::feature_not_supported)
596
- throw sycl::exception (
597
- make_error_code (errc::profiling),
598
- std::string (" Unable to get command group submission time: " ) +
599
- e.what ());
600
- std::rethrow_exception (std::current_exception ());
601
- }
602
- } else {
603
- // Returning host time
604
- using namespace std ::chrono;
605
- MSubmitTime =
606
- duration_cast<nanoseconds>(steady_clock::now ().time_since_epoch ())
607
- .count ();
569
+
570
+ if (QueueImplPtr Queue = MQueue.lock ()) {
571
+ try {
572
+ MSubmitTime = Queue->getDeviceImpl ().getCurrentDeviceTime ();
573
+ } catch (sycl::exception &e) {
574
+ if (e.code () == sycl::errc::feature_not_supported)
575
+ throw sycl::exception (
576
+ make_error_code (errc::profiling),
577
+ std::string (" Unable to get command group submission time: " ) +
578
+ e.what ());
579
+ std::rethrow_exception (std::current_exception ());
608
580
}
609
581
} else {
610
- // Capture the host timestamp for a return value of function call
611
- // <info::event_profiling::command_submit>. See MFallbackProfiling
612
- MSubmitTime = getTimestamp ();
582
+ // Returning host time
583
+ using namespace std ::chrono;
584
+ MSubmitTime =
585
+ duration_cast<nanoseconds>(steady_clock::now ().time_since_epoch ())
586
+ .count ();
613
587
}
614
588
}
615
589
616
- void event_impl::setHostEnqueueTime () {
617
- if (!MIsProfilingEnabled || !MFallbackProfiling)
618
- return ;
619
- // Capture a host timestamp to use normalize profiling time in
620
- // <command_start> and <command_end>. See MFallbackProfiling
621
- MHostBaseTime = getTimestamp ();
622
- }
623
-
624
590
uint64_t event_impl::getSubmissionTime () { return MSubmitTime; }
625
591
626
592
bool event_impl::isCompleted () {
0 commit comments