Skip to content

Commit

Permalink
uncommented CSR Matrix . tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpalumbo committed May 10, 2017
1 parent 4bcaa00 commit 961aee9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
18 changes: 10 additions & 8 deletions cuda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@
<!--this is what scalatest recommends to do to enable scala tests -->

<!-- disable surefire -->
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-surefire-plugin</artifactId>-->
<!--<configuration>-->
<!--<skipTests>true</skipTests>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- enable scalatest -->
<plugin>
<groupId>org.scalatest</groupId>
Expand All @@ -115,10 +115,12 @@
</execution>
</executions>
<configuration>
<argLine>-Xmx4g</argLine>
<argLine>-Xmx4g</argLine>
</configuration>
</plugin>



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
9 changes: 2 additions & 7 deletions cuda/src/main/scala/org/apache/mahout/cuda/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* limitations under the License.
*/

// Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.

package org.apache.mahout

Expand All @@ -36,15 +35,11 @@ import jcuda.jcublas._

import jcuda.jcusparse.JCusparse._






package object cuda {

private implicit val log = getLog(GPUMMul.getClass)


/** Copy cuda data back into a Mahout DenseMatrix
*
* @param src a (flattened) 2D cuda array
Expand All @@ -57,7 +52,7 @@ package object cuda {

var dbuff = new Pointer()

// again will be doullbe copying.. consider copying directly from cuda memory
// again will be double copying.. consider copying directly from cuda memory
// into each row..
val jvmData = Array.ofDim[Double](nrowIntern,ncolIntern) //Double](nrowIntern * ncolIntern)
val cudaData = new Array[Double](nrowIntern * ncolIntern)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ object UserSetCUDATestSuite {
print(s"Mahout JCuda Sparse multiplication time: $ms ms.")

// TODO: Ensure that we've been working with the same matrices.
// (mxC - mxCuda).norm / mxC.nrow / mxC.ncol should be < 1e-16
// (mxC - fromCudaCmpMatrix(mxCuda)).norm / mxC.nrow / mxC.ncol should be < 1e-16
assert(((Math.abs((mxC - fromCudaCmpMatrix(mxCuda)).norm / mxC.nrow / mxC.ncol)) - 1e-16) < 0)
ms
}

Expand Down

0 comments on commit 961aee9

Please sign in to comment.