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

Change the default execution policy behavior of the OpenACC backend #6772

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

seyonglee
Copy link
Contributor

Change the default execution policy behavior of the OpenACC backend from synchronous to asynchronous executions.

  • Change the default OpenACC async_arg value from acc_async_sync to acc_async_noval.
  • Add acc_wait(async_arg) to scalar reduction operations (parallel_reduce()).

…rom synchronous to asynchronous executions.

- Change the default OpenACC async_arg value from acc_async_sync to acc_async_noval.
- Add acc_wait(async_arg) to scalar reduction operations (parallel_reduce()).
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Are kernels still executed in the same order they were submitted (and non-overlapping) with this changes?

@@ -35,15 +35,15 @@ class OpenACCInternal {

public:
static int m_acc_device_num;
int m_async_arg = acc_async_sync;
int m_async_arg = acc_async_noval;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between acc_async_noval and acc_async_sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

acc_async_novel means that the kernels are submitted to a default asynchronous queue, and acc_async_sync means that kernels are submitted to a default synchronous queue.

@seyonglee
Copy link
Contributor Author

Are kernels still executed in the same order they were submitted (and non-overlapping) with this changes?

In the OpenACC execution model, all tasks submitted to the same OpenACC queue will be executed in order.

Copy link
Member

@crtrott crtrott left a comment

Choose a reason for hiding this comment

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

I think this is ok. We could possibly add a comment in the places where acc_async_noval is used directly that these are places where execution space instances (as a representation of the queue) may need to be passed in.

@dalg24
Copy link
Member

dalg24 commented Feb 1, 2024

The OpenACC build passed

@dalg24 dalg24 merged commit cc6ecf0 into kokkos:develop Feb 1, 2024
30 of 31 checks passed
@masterleinad masterleinad mentioned this pull request Feb 9, 2024
seyonglee added a commit to seyonglee/kokkos that referenced this pull request May 15, 2024
…am-policy) constructs in the OpenACC backend.

    - This PR handles a missing case not covered by the previous PR kokkos#6772
This PR also fixes the OpenACC backend error in the thread-safety test in PR kokkos#6938.
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