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

[OKL] Adds @directive preprocessor attribute #246

Merged
merged 4 commits into from
Aug 9, 2019

Conversation

dmed256
Copy link
Member

@dmed256 dmed256 commented Aug 9, 2019

Description

When using stringification macros such as OCCA_JIT, there is no way to add preprocessor directives such as

OCCA_JIT(
  props,
  (entries, a, b, ab),
  (
    for (int block = 0; block < entries; block += 16; @outer) {
      #pragma ivdep
      for (int i = block; i < (block + 16); ++i; @inner) {
        ...
      }
    }
  )
)

Introducing @directive which replaces

#pragma ivdep

with

@directive("#pragma ivdep")

resulting in the code looking like:

OCCA_JIT(
  props,
  (entries, a, b, ab),
  (
    for (int block = 0; block < entries; block += 16; @outer) {
      @directive("#pragma ivdep")
      for (int i = block; i < (block + 16); ++i; @inner) {
        ...
      }
    }
  )
)

@codecov
Copy link

codecov bot commented Aug 9, 2019

Codecov Report

Merging #246 into master will increase coverage by 0.09%.
The diff coverage is 85.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #246      +/-   ##
==========================================
+ Coverage    71.9%   71.99%   +0.09%     
==========================================
  Files         276      276              
  Lines       19290    19376      +86     
==========================================
+ Hits        13870    13950      +80     
- Misses       5420     5426       +6
Impacted Files Coverage Δ
src/lang/macro.cpp 81.91% <0%> (ø) ⬆️
src/lang/tokenizer.cpp 79.65% <40%> (+0.03%) ⬆️
src/lang/preprocessor.cpp 72.09% <90.62%> (+2.59%) ⬆️
src/lang/specialMacros.cpp 60.16% <0%> (+0.84%) ⬆️

@dmed256 dmed256 merged commit 25841d5 into master Aug 9, 2019
@dmed256 dmed256 deleted the add-directive-attribute branch August 9, 2019 04:34
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.

1 participant