Tencent Kona JDK11 向量计算版(Vector API)使用文档 - Tencent/TencentKona-11 GitHub Wiki

作者:傅杰

Vector API 接口

使用接口见Release:Tencent Kona JDK 11.0.8-GA for Vector API 对应的java doc。

https://github.com/Tencent/TencentKona-11/releases/tag/kona11.0.8-vector-api

Vector API注意事项

Vector API使用的SIMD指令和CPU型号强相关,所以生产使用一定要确保相关CPU型号预先测试过,否则可能导致性能和稳定性问题。

CPU型号查询方法

不同操作系统上,CPU型号可以通过以下命令进行查询

操作系统 查询命令
Linux cat /proc/cpuinfo
MacOS sysctl machdep.cpu.brand_string
Windows 查看“我的电脑”中处理器相关信息

例如,Linux系统上使用cat /proc/cpuinfo命令,在某AVX512机型上可得到以下信息。注意到其中“model name”的字段为“Intel(R) Xeon(R) Platinum 8255C CPU”,即为CPU的型号。

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz
stepping        : 7
microcode       : 0x5000021
cpu MHz         : 2501.000
cache size      : 36608 KB
physical id     : 0
siblings        : 48
core id         : 0
cpu cores       : 24
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc dtherm ida arat pln pts
bogomips        : 4988.27
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

CPU型号验证情况

CPU型号 已验证过的内容 备注
Intel(R) Xeon(R) Platinum 8255C CPU JDK基础测试集 avx512{f,dq,cd,bw,vl}
Intel(R) Xeon(R) CPU E5-2620 v3 JDK基础测试集 AVX256
Intel(R) Core(TM) i7-9750H CPU JDK基础测试集 AVX256
AMD EPYC Processor JDK基础测试集 AVX256
AMD EPYC 7K62 48-Core Processor 即:AMD Zen 2 (Rome) JDK基础测试集 与AMD EPYC Processor相比,
硬件新增flag:
  - amd_dcm:multi-node processor
  - topoext:Topology Extensions CPUID leafs

参考资料

AMD处理器硬件标记含义:https://unix.stackexchange.com/questions/43539/what-do-the-flags-in-proc-cpuinfo-mean