-
-
Save raver119/92b615704ca1bf169aa23a6a6e7d9880 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void orderingShowcase_1() { | |
Nd4j.setDataType(DataBuffer.Type.FLOAT); | |
val order = new char[]{'c','f'}; | |
val iterations = 10000; | |
val list = new ArrayList<Long>(); | |
val k = 4; | |
val m = 4; | |
val n = 4; | |
for (val aOrder: order) { | |
for (val bOrder: order) { | |
for (val cOrder: order) { | |
val a = Nd4j.rand(aOrder, new int[]{m, k}); | |
val b = Nd4j.rand(bOrder, new int[]{k, n}); | |
val c = Nd4j.rand(cOrder, new int[]{m, n}); | |
val name = new String("" + aOrder + bOrder + cOrder).toUpperCase(); | |
val timeStart = System.nanoTime(); | |
for (int e = 0; e < iterations; e++) | |
a.mmuli(b, c); | |
val timeEnd = System.nanoTime(); | |
log.info("Orders: {}; Time: {} ns;", name, ((timeEnd - timeStart) / iterations)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment