@@ -160,9 +160,7 @@ event_impl::event_impl(ur_event_handle_t Event, const context &SyclContext)
160160}
161161
162162event_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 } {
166164 if (Queue)
167165 this ->setContextImpl (Queue->getContextImplPtr ());
168166 else {
@@ -181,7 +179,6 @@ event_impl::event_impl(const QueueImplPtr &Queue)
181179void event_impl::setQueue (const QueueImplPtr &Queue) {
182180 MQueue = Queue;
183181 MIsProfilingEnabled = Queue->MIsProfilingEnabled ;
184- MFallbackProfiling = MIsProfilingEnabled && Queue->isProfilingFallback ();
185182
186183 // TODO After setting the queue, the event is no longer default
187184 // constructed. Consider a design change which would allow
@@ -348,17 +345,8 @@ event_impl::get_profiling_info<info::event_profiling::command_start>() {
348345 if (!MIsHostEvent) {
349346 auto Handle = getHandle ();
350347 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 ());
362350 }
363351 return 0 ;
364352 }
@@ -376,17 +364,8 @@ uint64_t event_impl::get_profiling_info<info::event_profiling::command_end>() {
376364 if (!MIsHostEvent) {
377365 auto Handle = this ->getHandle ();
378366 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 ());
390369 }
391370 return 0 ;
392371 }
@@ -587,40 +566,27 @@ void event_impl::cleanDepEventsThroughOneLevel() {
587566void event_impl::setSubmissionTime () {
588567 if (!MIsProfilingEnabled && !MProfilingTagEvent)
589568 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 ());
608580 }
609581 } 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 ();
613587 }
614588}
615589
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-
624590uint64_t event_impl::getSubmissionTime () { return MSubmitTime; }
625591
626592bool event_impl::isCompleted () {
0 commit comments