Skip to content

Commit

Permalink
[Parser] Fixed an issue where register variables initialized to value…
Browse files Browse the repository at this point in the history
…s in shared were being migrated in OpenCL mode (#167)
  • Loading branch information
noelchalmers authored and dmed256 committed Jul 21, 2018
1 parent 405fb35 commit 86efdaf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lang/modes/opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ namespace occa {
statementExprMap::iterator it = exprMap.begin();
while (it != exprMap.end()) {
declarationStatement &declSmnt = *((declarationStatement*) it->first);
declSmnt.removeFromParent();
kernelSmnt.addFirst(declSmnt);

variable_t *var = declSmnt.declarations[0].variable;

if (var->hasAttribute("shared")) {
declSmnt.removeFromParent();
kernelSmnt.addFirst(declSmnt);
}
++it;
}
}
Expand Down

0 comments on commit 86efdaf

Please sign in to comment.