Add environment reporter
This commit is contained in:
24
timings/src/main/java/com/ankurm/vectorapi/Env.java
Normal file
24
timings/src/main/java/com/ankurm/vectorapi/Env.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.ankurm.vectorapi;
|
||||
|
||||
import jdk.incubator.vector.*;
|
||||
|
||||
/** Prints the exact environment a benchmark run happened on. */
|
||||
public final class Env {
|
||||
public static void print() {
|
||||
Runtime rt = Runtime.getRuntime();
|
||||
System.out.println("=== environment ===");
|
||||
System.out.println("JDK : " + System.getProperty("java.vm.name")
|
||||
+ " " + System.getProperty("java.vm.version"));
|
||||
System.out.println("java.version : " + System.getProperty("java.version"));
|
||||
System.out.println("OS : " + System.getProperty("os.name") + " "
|
||||
+ System.getProperty("os.version") + " (" + System.getProperty("os.arch") + ")");
|
||||
System.out.println("Available procs: " + rt.availableProcessors());
|
||||
System.out.println("Preferred spec : " + FloatVector.SPECIES_PREFERRED
|
||||
+ " (" + FloatVector.SPECIES_PREFERRED.length() + " float lanes, "
|
||||
+ FloatVector.SPECIES_PREFERRED.vectorBitSize() + "-bit)");
|
||||
System.out.println("Max vector size: " + IntVector.SPECIES_PREFERRED.vectorBitSize() + "-bit (int)");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
private Env() {}
|
||||
}
|
||||
Reference in New Issue
Block a user