stress-ng 测试cpu 压力方法

https://kernel.ubuntu.com/~cking/stress-ng/

stress-ng 测试cpu 压力方法

 

CPU specific stress methods

These can be specified using the --cpu-method option, available methods are:

ackermannAckermann function: compute A(3, 10), where:
 A(m, n) = n + 1 if m = 0;
 A(m - 1, 1) if m > 0 and n = 0;
 A(m - 1, A(m, n - 1)) if m > 0 and n > 0
bitopsvarious bit operations from bithack, namely: reverse bits, parity check, bit count, round to nearest power of 2
callfuncrecursively call 8 argument C function to a depth of 1024 calls and unwind
cdouble1000 iterations of a mix of double floating point complex operations
cfloat1000 iterations of a mix of floating point complex operations
clongdouble1000 iterations of a mix of long double floating point complex operations
correlateperform a 16384 * 1024 correlation of random doubles
crc16compute 1024 rounds of CCITT CRC16 on random data
decimal321000 iterations of a mix of 32 bit decimal floating point operations (GCC only)
decimal641000 iterations of a mix of 64 bit decimal floating point operations (GCC only)
decimal1281000 iterations of a mix of 128 bit decimal floating point operations (GCC only)
ditherFloyd鈥揝teinberg dithering of a 1024 脳 768 random image from 8 bits down to 1 bit of depth
djb2a128 rounds of hash DJB2a (Dan Bernstein hash using the xor variant) on 128 to 1 bytes of random strings
double1000 iterations of a mix of double precision floating point operations
eulercompute e using n = (1 + (1 / n))n
explogiterate on n = exp(log(n) / 1.00002)
fibonaccicompute Fibonacci sequence of 0, 1, 1, 2, 5, 8...
fft4096 sample Fast Fourier Transform
float1000 iterations of a mix of floating point operations
fnv1a128 rounds of hash FNV-1a (Fowler-Noll-Vo hash using the xor then multiply variant) on 128 to 1 bytes of random strings
gammacalculate the Euler-Mascheroni constant γ using the limiting difference between the harmonic series (1 + 1/2 + 1/3 + 1/4 + 1/5 ... + 1/n) and the natural logarithm ln(n), for n = 80000.
gcdcompute GCD of integers
graycalculate binary to gray code and gray code back to binary for integers from 0 to 65535
hammingcompute Hamming H(8,4) codes on 262144 lots of 4 bit data. This turns 4 bit data into 8 bit Hamming code containing 4 parity bits. For data bits d1..d4, parity bits are computed as:
  p1 = d2 + d3 + d4
  p2 = d1 + d3 + d4
  p3 = d1 + d2 + d4
  p4 = d1 + d2 + d3
hanoisolve a 21 disc Towers of Hanoi stack using the recursive solution
hyperboliccompute sinh(θ) * cosh(θ) + sinh(2θ) + cosh(3θ) for float, double and long double hyperbolic sine and cosine functions where θ = 0 to 2 * π in 1500 steps
idct8 * 8 IDCT (Inverse Discrete Cosine Transform)
int8mix of 8 bit integer operations
int16mix of 16 bit integer operations
int32mix of 32 bit integer operations
int64mix of 64 bit integer operations
int128mix of 128 bit integer operations
int32floatmix of 32 bit integer and floating point operations
int32doublemix of 32 bit integer and double precision floating point operations
int32longdoublemix of 32 bit integer and long double pointing operations
int64floatmix of 64 bit integer and floating point operations
int64doublemix of 64 bit integer and double precision floating point operations
int64longdoublemix of 64 bit integer and long double pointing operations
int128floatmix of 128 bit integer and floating point operations
int128doublemix of 128 bit integer and double precision floating point operations
int128longdoublemix of 128 bit integer and long double pointing operations
int128idecimal32mix of 128 bit integer and 32 bit decimal pointing operations
int128idecimal64mix of 128 bit integer and 64 bit decimal pointing operations
int128idecimal128mix of 128 bit integer and 128 bit decimal pointing operations
jenkinJenkin's integer hash on 128 rounds of 128..1 bytes of random data
jmpSimple unoptimised compare <, >, == and jmp branching
ln2compute ln(2) based on series: 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 ...
longdouble1000 iterations of a mix of long double precision floating point operations
loopsimple empty loop
maxtrixprodmatrix product of two 128 * 128 matrices of double floats. Testing on 64 bit x86 hardware shows that this is provides a good mix of memory, cache and floating point operations and is probably the best CPU method to use to make a CPU run hot.
nsqrtsqrt() using Newton-Raphson
omegacompute the omega constant defined by ΩeΩ = 1 using efficient iteration of Ωn+1 = (1 + Ωn) / (1 + eΩn)
paritycompute parity using various methods from the Standford Bit Twiddling Hacks. Methods employed are: the na茂ve way, the na茂ve way with the Brian Kernigan bit counting optimisation, the multiply way, the parallel way, and the lookup table ways (2 variations)
phicompute the Golden Ratio φ using series
picompute π using the Srinivasa Ramanujan fast convergence algorithm
pjw128 rounds of hash pjw function on 128 to 1 bytes of random strings
primefind all the primes in the range 1..1000000 using a slightly optimised brute force naive trial division search
psicompute ψ (the reciprocal Fibonacci constant) using the sum of the reciprocals of the Fibonacci numbers
queenscompute all the solutions of the classic 8 queens problem for board sizes 1..12
rand16384 iterations of rand(), where rand is the MWC pseudo random number generator. The MWC random function concatenates two 16 bit multiply-with-carry generators:
  x(n) = 36969 * x(n - 1) + carry,
  y(n) = 18000 * y(n - 1) + carry mod 216
rgbconvert RGB to YUV and back to RGB (CCIR 601)
sdbm128 rounds of hash sdbm (as used in the SDBM database and GNU awk) on 128 to 1 bytes of random strings
trigcompute sin(θ) * cos(θ) + sin(2θ) + cos(3θ) for float, double and long double sine and cosine functions where θ = 0 to 2 * π in 1500 steps
zetacompute the Riemann Zeta function ζ(s) for s = 2.0..10.0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值