Skip to content

Commit

Permalink
Remove tests moved to apitest package
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrich committed Apr 27, 2023
1 parent 2a195f7 commit 3f539f1
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions sblas/src/test/scala/org/ekrich/blas/unsafe/BlasTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ class BlasTest {
}
}

@Test def test_blas_dnrm2(): Unit = {
val x = Array[Double](1, 2, -2)
val res = Blas.dnrm2(x)
assertEquals(res, 3.0, 0.0)
}

@Test def test_cblas_dasum(): Unit = {
Zone { implicit z =>
val X = DoubleArray(1, 2, -2)
Expand Down Expand Up @@ -266,46 +260,4 @@ class BlasTest {
assertEquals(res, 1)
}
}

// Level 3 Tests

/*
[ 0.11 0.12 0.13 ] [ 1011 1012 ] [ 367.76 368.12 ]
[ 0.21 0.22 0.23 ] [ 1021 1022 ] = [ 674.06 674.72 ]
[ 1031 1032 ]
*/
@Test def test_cblas_sgemm(): Unit = {
// here until added to the API
import scala.scalanative.unsafe._
import blasEnums._
val lda = 3

val A = Array(
0.11f, 0.12f, 0.13f,
0.21f, 0.22f, 0.23f)

val ldb = 2

val B = Array(
1011f, 1012f,
1021f, 1022f,
1031f, 1032f)

val ldc = 2
// format: off
val C = Array(
0.00f, 0.00f,
0.00f, 0.00f)

/* Compute C = A B */

cblas_sgemm (
CblasRowMajor,
CblasNoTrans, CblasNoTrans, 2, 2, 3,
1.0f, A.at(0), lda, B.at(0), ldb, 0.0f, C.at(0), ldc)

printf ("[ %g, %g\n", C(0), C(1))
printf (" %g, %g ]\n", C(2), C(3))
assertArrayEquals(Array(367.760f, 368.120f, 674.060f, 674.720f), C, 0.0f)
}
}

0 comments on commit 3f539f1

Please sign in to comment.