Skip to content

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.

2 participants