How to use the Intel AVX in Java?

前端 未结 5 915
不思量自难忘°
不思量自难忘° 2021-02-19 07:51

How do I use the Intel AVX vector instruction set from Java? It\'s a simple question but the answer seems to be hard to find.

5条回答
  •  不思量自难忘°
    2021-02-19 08:20

    Depending on the work, you may not have to do much. AVX2 is used automatically by JVM on some operations on Arrays and String, on supporting platforms like Haswell onwards and Xeon v3 onwards.

    https://software.intel.com/en-us/articles/java-application-performance-improvement-with-intel-xeon-processor-e7-v3

    https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2

    From Ryzen 3 / Epyc Rome, you'll also have single cycle AVX2 on AMD processors: https://www.anandtech.com/print/14525/amd-zen-2-microarchitecture-analysis-ryzen-3000-and-epyc-rome

    Direct use of the instructions and intrinsics are not easily available though.

提交回复
热议问题