aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-04-25 03:31:01 +0200
committerSven Göthel <[email protected]>2024-04-25 03:31:01 +0200
commit59420652c96956c7d9d4e501200ddbe91edc1c34 (patch)
treed255e80701903d7277faf2b9a954fe5cce66121f
parent3541b44659df4b021131270752fdf582d7f04f56 (diff)
TestMatrix4f02MulNOUI: Align w/ native jaulib
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/math/TestMatrix4f02MulNOUI.java36
2 files changed, 33 insertions, 7 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 4447847cf..a8046492d 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -600,7 +600,7 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.math.TestGluUnprojectFloatNOUI $*
#testnoawt com.jogamp.opengl.test.junit.math.TestGluUnprojectDoubleNOUI $*
#testnoawt com.jogamp.opengl.test.junit.math.TestMatrix4f01NOUI $*
-#testnoawt com.jogamp.opengl.test.junit.math.TestMatrix4f02MulNOUI $*
+testnoawt com.jogamp.opengl.test.junit.math.TestMatrix4f02MulNOUI $*
#testnoawt com.jogamp.opengl.test.junit.math.TestMatrix4f03InversionNOUI $*
#testnoawt com.jogamp.opengl.test.junit.math.TestMatrix4fMatrixMulNOUI $*
#testnoawt com.jogamp.opengl.test.junit.math.TestMatrix4fProject01NOUI $*
@@ -1011,7 +1011,7 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.demos.graph.GPURegionNewtDemo $*
#testnoawt com.jogamp.opengl.demos.graph.ui.UIShapeClippingDemo00 $*
##testnoawt com.jogamp.opengl.demos.graph.ui.UIShapeClippingDemo01 $*
-testnoawt com.jogamp.opengl.demos.graph.ui.FontView01 $*
+#testnoawt com.jogamp.opengl.demos.graph.ui.FontView01 $*
#testnoawt com.jogamp.opengl.demos.graph.ui.UIMediaGrid01 $*
#testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo03 $*
#testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo20 $*
diff --git a/src/test/com/jogamp/opengl/test/junit/math/TestMatrix4f02MulNOUI.java b/src/test/com/jogamp/opengl/test/junit/math/TestMatrix4f02MulNOUI.java
index a2cc5a3f3..090dcf6e7 100644
--- a/src/test/com/jogamp/opengl/test/junit/math/TestMatrix4f02MulNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/math/TestMatrix4f02MulNOUI.java
@@ -106,7 +106,7 @@ public class TestMatrix4f02MulNOUI extends JunitTracer {
final Matrix4fb res_n = new Matrix4fb();
final int warmups = 1000;
- final int loops = 10*1000*1000;
+ final int loops = 25*1000*1000;
long tI1 = 0;
long tI2 = 0;
long tI4a = 0;
@@ -138,6 +138,9 @@ public class TestMatrix4f02MulNOUI extends JunitTracer {
}
tI2 = Platform.currentTimeMillis() - t_0;
+ // avoid optimizing out unused computation results by simply adding up determinat
+ double dr = 1;
+
//
// Matrix4f
//
@@ -145,26 +148,36 @@ public class TestMatrix4f02MulNOUI extends JunitTracer {
// warm-up
for(int i=0; i<warmups; i++) {
res_m.mul(m1, m2);
+ dr += res_m.determinant();
res_m.mul(m2, m1);
+ dr += res_m.determinant();
}
t_0 = Platform.currentTimeMillis();
for(int i=0; i<loops; i++) {
res_m.mul(m1, m2);
+ dr += res_m.determinant();
res_m.mul(m2, m1);
+ dr += res_m.determinant();
}
tI4a = Platform.currentTimeMillis() - t_0;
- res_m.load(m1);
-
// warm-up
for(int i=0; i<warmups; i++) {
+ res_m.load(m1);
res_m.mul(m2);
+ dr += res_m.determinant();
+ res_m.load(m2);
res_m.mul(m1);
+ dr += res_m.determinant();
}
t_0 = Platform.currentTimeMillis();
for(int i=0; i<loops; i++) {
+ res_m.load(m1);
res_m.mul(m2);
+ dr += res_m.determinant();
+ res_m.load(m2);
res_m.mul(m1);
+ dr += res_m.determinant();
}
tI4b = Platform.currentTimeMillis() - t_0;
@@ -175,29 +188,42 @@ public class TestMatrix4f02MulNOUI extends JunitTracer {
// warm-up
for(int i=0; i<warmups; i++) {
res_n.mul(n1, n2);
+ dr += res_m.determinant();
res_n.mul(n2, n1);
+ dr += res_m.determinant();
}
t_0 = Platform.currentTimeMillis();
for(int i=0; i<loops; i++) {
res_n.mul(n1, n2);
+ dr += res_m.determinant();
res_n.mul(n2, n1);
+ dr += res_m.determinant();
}
tI5a = Platform.currentTimeMillis() - t_0;
-
- res_n.load(n1);
+ Assert.assertTrue( dr > 0 );
// warm-up
for(int i=0; i<warmups; i++) {
+ res_n.load(n1);
res_n.mul(n2);
+ dr += res_m.determinant();
+ res_n.load(n2);
res_n.mul(n1);
+ dr += res_m.determinant();
}
t_0 = Platform.currentTimeMillis();
for(int i=0; i<loops; i++) {
+ res_n.load(n1);
res_n.mul(n2);
+ dr += res_m.determinant();
+ res_n.load(n2);
res_n.mul(n1);
+ dr += res_m.determinant();
}
tI5b = Platform.currentTimeMillis() - t_0;
+ Assert.assertTrue( dr > 0 );
+ System.err.printf("Checkmark %f%n", dr);
System.err.printf("Summary loops %6d: I1 %6d ms total, %f us/mul%n", loops, tI1, tI1*1e3/loops);
System.err.printf("Summary loops %6d: I2 %6d ms total, %f us/mul, I2 / I1 %f%%%n", loops, tI2, tI2*1e3/2.0/loops, (double)tI2/(double)tI1*100.0);
System.err.printf("Summary loops %6d: I4a %6d ms total, %f us/mul, I4a / I2 %f%%, I4a / I4b %f%%%n", loops, tI4a, tI4a*1e3/2.0/loops, (double)tI4a/(double)tI2*100.0, (double)tI4a/(double)tI4b*100.0);