0

Currently, I'm implementing an Android tool to display some device info on UI. But for CPU info, I cannot find any solution to get its instruction set (for example: SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, XOP, FMA3/4, NEON, Altivec...)

I want to get this info with Android java code, is that possible?

Thank you all!

Tom Dong
  • 79
  • 6

1 Answers1

0

You can fetch that info from /proc/cpuinfo. Use this code:

BufferedReader br = new BufferedReader(new FileReader(new File("/proc/cpuinfo")));
String line;
StringBuilder cpuInfo = new StringBuilder();
while ((line = br.readLine()) != null) {
    sb.append(aLine + "\n");
}
Log.i(TAG, "CPU info: " + sb.toString());

The output of this command will contain all those flags plus extra information about the CPU speed and state.

Note that on devices with multiple processors or cores, you will see separate information for each of the CPUs... although it's likely that CPU flags would be the same for all.

Mike Laren
  • 8,028
  • 17
  • 51
  • 70