Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/scala/com/nec/spark/agile/core/CodeLines.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.nec.spark.agile.core

import scala.annotation.tailrec
import sourcecode.{FullName, Line}

import scala.annotation.tailrec

object CodeLines {
def parse(source: String): CodeLines = {
CodeLines.from(source.split("\\r?\\n").toList)
Expand All @@ -29,8 +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(
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
@@ -1,10 +1,9 @@
package com.nec.spark.agile.projection

import com.nec.spark.agile.core._
import com.nec.spark.agile.CFunctionGeneration._
import com.nec.spark.agile.StringProducer.FrovedisStringProducer
import com.nec.spark.agile.core._
import com.nec.spark.agile.core.CFunction2.CFunctionArgument
import com.nec.spark.agile.core._

final case class ProjectionFunction(name: String,
data: Seq[CVector],
Expand Down Expand Up @@ -59,10 +58,24 @@ final case class ProjectionFunction(name: String,
"#pragma _NEC vector",
CodeLines.forLoop("i", s"${inputs.head.name}->count") {
List(
s"bool validity = ${cexpr.isNotNullCode.getOrElse("1")};",
s"$outname->data[i] = ${cexpr.cCode};",
s"$outname->set_validity(i, validity);"
s"${outname}->data[i] = ${cexpr.cCode};",
)
},
if (cexpr.isNotNullCode.isEmpty) {
CodeLines.from(
s"size_t vcount = ceil(${inputs.head.name}->count / 64.0);",
CodeLines.forLoop("i", s"vcount", vector = true) {
List(
s"${outname}->validityBuffer[i] = 0xffffffff;"
)
}
)
} else {
CodeLines.forLoop("i", s"${inputs.head.name}->count", vector = true) {
List(
s"$outname->set_validity(i, ${cexpr.isNotNullCode.getOrElse("1")});"
)
}
}
)
}
Expand Down
Binary file removed tests/tpchbench/dbgen/dbgen
Binary file not shown.
Binary file removed tests/tpchbench/dbgen/qgen
Binary file not shown.
6 changes: 5 additions & 1 deletion tests/tpchbench/run_ve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ time $SPARK_HOME/bin/spark-submit \
--conf spark.executorEnv.VE_OMP_NUM_THREADS=1 \
--conf spark.com.nec.spark.aggregate-on-ve=true \
--conf spark.com.nec.spark.sort-on-ve=true \
--conf spark.com.nec.spark.project-on-ve=false \
--conf spark.com.nec.spark.project-on-ve=true \
--conf spark.com.nec.spark.filter-on-ve=true \
--conf spark.com.nec.spark.exchange-on-ve=true \
--conf spark.com.nec.spark.join-on-ve=false \
Expand All @@ -31,3 +31,7 @@ time $SPARK_HOME/bin/spark-submit \
--conf spark.shuffle.partitions=8 \
target/scala-2.12/tpchbench-assembly-0.0.1.jar \
$*

# --conf spark.executorEnv.VE_PROGINF=YES \
# --conf spark.executorEnv.VE_ACC_IO=1 \
# --conf spark.executorEnv.VEO_LOG_DEBUG=1 \