Skip to content

Commit

Permalink
Make _NEC vector pragma explicit.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmeddie committed Apr 22, 2022
1 parent fda9730 commit 95875d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/com/nec/spark/agile/core/CodeLines.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ object CodeLines {
CodeLines.from(s"if ($condition) { ", sub1.indented, "} else {", sub2.indented, "}")
}

def forLoop(counter: String, until: String)(sub: => CodeLines): CodeLines = {
def forLoop(counter: String, until: String, vector: Boolean = false)(sub: => CodeLines): CodeLines = {
CodeLines.from(
"#pragma _NEC vector",
if (vector) "#pragma _NEC vector" else "",
s"for (auto $counter = 0; $counter < $until; $counter++) {",
sub.indented,
"}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ case class ProjectionFunction(name: String,
if (cexpr.isNotNullCode.isEmpty) {
CodeLines.from(
s"size_t vcount = ceil(${inputs.head.name}->count / 64.0);",
CodeLines.forLoop("i", s"vcount") {
CodeLines.forLoop("i", s"vcount", vector = true) {
List(
s"${outname}->validityBuffer[i] = 0xffffffff;"
)
}
)
} else {
CodeLines.forLoop("i", s"${inputs.head.name}->count") {
CodeLines.forLoop("i", s"${inputs.head.name}->count", vector = true) {
List(
s"$outname->set_validity(i, ${cexpr.isNotNullCode.getOrElse("1")});"
)
Expand Down

0 comments on commit 95875d1

Please sign in to comment.