Skip to content

Commit

Permalink
#7: Clean up the println statements from the code
Browse files Browse the repository at this point in the history
  • Loading branch information
meisam committed Jan 15, 2015
1 parent 8923a90 commit 7e3c36f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ class GpuFilteredPartition[T <: Product : ClassTag, U: ClassTag : TypeTag]
extends GpuPartition[T](context, columnTypes, capacity) {

override def fill(iter: Iterator[T]): Unit = {
val startTransformDataTime = System.nanoTime
super.fill(iter)
val endTransformDataTime = System.nanoTime
val startSelectionTotalTime = System.nanoTime
val resultSize = filter[U](colIndex, value, operation)

intData.zipWithIndex.filter(_._1 != null).foreach({
Expand Down Expand Up @@ -67,13 +64,6 @@ class GpuFilteredPartition[T <: Product : ClassTag, U: ClassTag : TypeTag]
}
})
size = resultSize
val endSelectionTotalTime = System.nanoTime

val totalTime = endSelectionTotalTime - startTransformDataTime
println("Test with size=%,12d".format(size))
println("Total transform time (ns) to copy %,12d elements of data = %,12d".format(-1, endTransformDataTime - startTransformDataTime))
println("Selection time (ns) = %,12d".format(endSelectionTotalTime - startSelectionTotalTime))
println("Total selection time (ns) = %,12d".format(totalTime))
}

}
8 changes: 0 additions & 8 deletions core/src/main/scala/org/apache/spark/rdd/GpuPartition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,7 @@ class GpuPartition[T <: Product : ClassTag]
}

def prescanArray(outArray: cl_mem, inArray: cl_mem, numElements: Int) {
val prefixsumStartTime = System.nanoTime
prescanArrayRecursive(outArray, inArray, numElements, 0, 0)
val prefixsumEndTime = System.nanoTime

println("Prefix Sum time = %,12d".format(prefixsumEndTime - prefixsumStartTime))
}

def scanImpl(d_input: cl_mem, rLen: Int, d_output: cl_mem) {
Expand Down Expand Up @@ -445,7 +441,6 @@ class GpuPartition[T <: Product : ClassTag]
def filter[V: ClassTag : TypeTag](columnIndex: Int, value: V, operation: ComparisonOperation.Value):
Int = {

val start: Long = System.nanoTime
val tupleNum = this.size
gpuCol = createReadWriteBuffer[V](tupleNum)

Expand Down Expand Up @@ -477,9 +472,7 @@ class GpuPartition[T <: Product : ClassTag]
clSetKernelArg(kernel, 2, Sizeof.cl_mem, Pointer.to(gpuCount))
clEnqueueNDRangeKernel(context.getOpenCLQueue, kernel, 1, null, global_work_size, local_work_size, 0, null, null)

val startPsum = System.nanoTime()
scanImpl(gpuCount, globalSize, gpuPsum)
val endPsum = System.nanoTime()

val tmp1 = Array[Int](0)
val tmp2 = Array[Int](0)
Expand All @@ -489,7 +482,6 @@ class GpuPartition[T <: Product : ClassTag]
deviceToHostCopy[Int](gpuPsum, pointer(tmp2), 1, globalSize - 1)

resCount = tmp1(0) + tmp2(0)
val end: Long = System.nanoTime
resCount
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ class GpuFilteredPartitionSuit extends FunSuite with SharedSparkContext {
(v.toLong, ((i % 3) == 0))
}).toArray

println(testData.mkString(","))
println("----------")
val gpuPartition = new GpuFilteredPartition[(Long, Boolean), Long](openCLContext, Array("LONG", "BOOLEAN"),
0, ComparisonOperation.<=, START + 5L, DEFAULT_CAPACITY)
gpuPartition.fill(testData.toIterator)
Expand Down

0 comments on commit 7e3c36f

Please sign in to comment.