Skip to content
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

Add synchronizes before/after managed_ptr kernels #277

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

adayton1
Copy link
Member

@adayton1 adayton1 commented Sep 10, 2024

managed_ptr kernels currently run in stream 0, which is different than the default stream used by RAJA. To prevent any cross stream race conditions, we synchronize before and after those kernels. In the future, we will likely use the same default stream used by RAJA and/or modify the API such that there is an overload that takes a camp resource or stream as an argument.

Copy link
Contributor

@robinson96 robinson96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MrBurmark
Copy link
Member

I thought the streams created by camp should be synchronous with stream 0.

@adayton1
Copy link
Member Author

I thought the streams created by camp should be synchronous with stream 0.

Is that true for both cuda and hip?

@MrBurmark
Copy link
Member

I know its true for cuda, and I assume its true for hip, but I'll check.

@adayton1
Copy link
Member Author

adayton1 commented Sep 10, 2024

I know its true for cuda, and I assume its true for hip, but I'll check.

I can't find anything concrete, but the hip documentation seems to hint at it.

EDIT: I found slides that seem to indicate it has the same behavior as CUDA. "No task on the NULL stream will begin until all previously enqueued tasks in all other streams have completed."

But this leads me to the question of whether tasks on other streams can start while tasks are running in the null stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants