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 the @nobarrier attribute to stop barriers from being added automatically to @inner loop blocks. #544

Merged
merged 2 commits into from
Dec 7, 2021

Conversation

kris-rowe
Copy link
Member

Description

Closes #484

Introduces an attribute @nobarrier to disable the automatic addition of barriers after @inner loop blocks that write to shared memory.

Usage

@kernel void f(int N) 
{  
  @outer
  for(int i=0; i < N; ++i) {
    @shared double x[3];

    @inner @nobarrier
    for(int j=0; j < N; ++j) {
      x[j] = 1.0;
    }

    @inner
    for(int j=0; j < N; ++j) {
      x[j] = 1.0;
    }
  }
}

added at the end of `@inner` loop blocks that write to `@shared` memory.
@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #544 (8e5401d) into main (1a4c374) will decrease coverage by 0.04%.
The diff coverage is 47.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #544      +/-   ##
==========================================
- Coverage   76.40%   76.36%   -0.05%     
==========================================
  Files         261      262       +1     
  Lines       19510    19523      +13     
==========================================
+ Hits        14906    14908       +2     
- Misses       4604     4615      +11     
Impacted Files Coverage Δ
...ca/internal/lang/builtins/attributes/noBarrier.cpp 30.76% <30.76%> (ø)
src/occa/internal/lang/modes/okl.cpp 93.12% <100.00%> (+0.03%) ⬆️
src/occa/internal/lang/modes/withLauncher.cpp 95.13% <100.00%> (+0.01%) ⬆️
src/occa/internal/lang/specialMacros.cpp 60.92% <0.00%> (-1.33%) ⬇️
src/occa/internal/utils/sys.cpp 76.62% <0.00%> (-0.11%) ⬇️

@kris-rowe kris-rowe merged commit 2abc3e9 into libocca:main Dec 7, 2021
@kris-rowe kris-rowe deleted the feature--nobarrier-attribute branch December 15, 2021 17:52
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.

Add option to disable automatic barriers
1 participant