-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the device timer conversion in cvk_device instead of commands #630
base: main
Are you sure you want to change the base?
Conversation
1d00885
to
cc94ea5
Compare
cc94ea5
to
0d4475e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for this change? Performance improvements?
if (sync_host > sync_dev) { | ||
return (sync_host - sync_dev) + dev; | ||
cl_ulong cvk_device::device_timer_to_host(cl_ulong dev) { | ||
if (dev > m_sync_dev) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (dev > m_sync_dev) { | |
if (dev <= m_sync_dev) { |
Isn't your condition backwards? You want a new pair of aligned timestamps only when you've wrapped around and the timestamp to convert to the host's time base is smaller than the device timestamp used as a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is backwards.
The idea is to get new sync points when the time we want is bigger than what we have converted so far. Because they might have been a slight divergence since we have the last sync point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you'll end up requesting a new pair of timestamps for pretty much each command since the device timestamp will almost always be greater than the last one obtained when getting a host/device pair. The only time where you're not requesting a host/device pair is when the device timestamp wraps around. At which point I don't see much motivation for the change.
From what I remember, this is needed to fix issues introduced by the new pattern from using timeline semaphore. |
I have rerun the CTS without this patch (but with the timeline semaphore) to remind me why this patch is needed with timeline semaphore. In the implementation I have, there is a race condition between the application thread and the executor thread. It can lead to the thread app looking for an event profiling info, because the event is complete, but the executor has not computed the profiling info. |
0d4475e
to
9d8994e
Compare
No description provided.