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:

ackermann Ackermann 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
bitops various bit operations from bithack, namely: reverse bits, parity check, bit count, round to nearest power of 2
callfunc recursively call 8 argument C function to a depth of 1024 calls and unwind
cdouble 1000 iterations of a mix of double floating point complex operations
cfloat 1000 iterations of a mix of floating point complex operations
clongdouble 1000 iterations of a mix of long double floating point complex operations
correlate perform a 16384 * 1024 correlation of random doubles
crc16 compute 1024 rounds of CCITT CRC16 on random data
decimal32 1000 iterations of a mix of 32 bit decimal floating point operations (GCC only)
decimal64 1000 iterations of a mix of 64 bit decimal floating point operations (GCC only)
decimal128 1000 iterations of a mix of 128 bit decimal floating point operations (GCC only)
dither Floyd鈥揝teinberg dithering of a 1024 脳 768 random image from 8 bits down to 1 bit of depth
djb2a 128 rounds of hash DJB2a (Dan Bernstein hash using the xor variant) on 128 to 1 bytes of random strings
double 1000 iterations of a mix of double precision floating point operations
euler compute e using n = (1 + (1 / n))n
explog iterate on n = exp(log(n) / 1.00002)
fibonacci compute Fibonacci sequence of 0, 1, 1, 2, 5, 8...
fft 4096 sample Fast Fourier Transform
float 1000 iterations of a mix of floating point operations
fnv1a 128 rounds of hash FNV-1a (Fowler-Noll-Vo hash using the xor then multiply variant) on 128 to 1 bytes of random strings
gamma calculate 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.
gcd compute GCD of integers
gray calculate binary to gray code and gray code back to binary for integers from 0 to 65535
hamming compute 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
hanoi solve a 21 disc Towers of Hanoi stack using the recursive solution
hyperbolic compute sinh(θ) * cosh(θ) + sinh(2θ) + cosh(3θ) for float, double and long double hyperbolic sine and cosine functions where θ = 0 to 2 * π in 1500 steps
idct 8 * 8 IDCT (Inverse Discrete Cosine Transform)
int8 mix of 8 bit integer operations
int16 mix of 16 bit integer operations
int32 mix of 32 bit integer operations
int64 mix of 64 bit integer operations
int128 mix of 128 bit integer operations
int32float mix of 32 bit integer and floating point operations
int32double mix of 32 bit integer and double precision floating point operations
int32longdouble mix of 32 bit integer and long double pointing operations
int64float mix of 64 bit integer and floating point operations
int64double mix of 64 bit integer and double precision floating point operations
int64longdouble mix of 64 bit integer and long double pointing operations
int128float mix of 128 bit integer and floating point operations
int128double mix of 128 bit integer and double precision floating point operations
int128longdouble mix of 128 bit integer and long double pointing operations
int128idecimal32 mix of 128 bit integer and 32 bit decimal pointing operations
int128idecimal64 mix of 128 bit integer and 64 bit decimal pointing operations
int128idecimal128 mix of 128 bit integer and 128 bit decimal pointing operations
jenkin Jenkin's integer hash on 128 rounds of 128..1 bytes of random data
jmp Simple unoptimised compare <, >, == and jmp branching
ln2 compute ln(2) based on series: 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 ...
longdouble 1000 iterations of a mix of long double precision floating point operations
loop simple empty loop
maxtrixprod matrix 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.
nsqrt sqrt() using Newton-Raphson
omega compute the omega constant defined by ΩeΩ = 1 using efficient iteration of Ωn+1 = (1 + Ωn) / (1 + eΩn)
parity compute 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)
phi compute the Golden Ratio φ using series
pi compute π using the Srinivasa Ramanujan fast convergence algorithm
pjw 128 rounds of hash pjw function on 128 to 1 bytes of random strings
prime find all the primes in the range 1..1000000 using a slightly optimised brute force naive trial division search
psi compute ψ (the reciprocal Fibonacci constant) using the sum of the reciprocals of the Fibonacci numbers
queens compute all the solutions of the classic 8 queens problem for board sizes 1..12
rand 16384 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
rgb convert RGB to YUV and back to RGB (CCIR 601)
sdbm 128 rounds of hash sdbm (as used in the SDBM database and GNU awk) on 128 to 1 bytes of random strings
trig compute sin(θ) * cos(θ) + sin(2θ) + cos(3θ) for float, double and long double sine and cosine functions where θ = 0 to 2 * π in 1500 steps
zeta compute the Riemann Zeta function ζ(s) for s = 2.0..10.0

猜你喜欢

转载自blog.csdn.net/z278718149/article/details/85273237