The interface is a bit annoying, but the tool is really cool.
100 cycles of matrixprod:
stress-ng -c1 --cpu-ops 100 --cpu-method matrixprod
man stress-ng gives the list of possible --cpu-method. It documents matrixprod as:
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.
If you don't specify the --cpu-method it apparently loops through every method one by one.
Limit time to 1s instead of limiting cycles:
stress-ng -c1 -t1 --cpu-method matrixprod