I am doing some performance analysis, and i wonder, whether numpy
vectorizes its standard array operations, when the datatype is known (double).
Yes, they are.
/*
* This file is for the definitions of simd vectorized operations.
*
* Currently contains sse2 functions that are built on amd64, x32 or
* non-generic builds (CFLAGS=-march=...)
* In future it may contain other instruction sets like AVX or NEON detected
* at runtime in which case it needs to be included indirectly via a file
* compiled with special options (or use gcc target attributes) so the binary
* stays portable.
*/
Link: Numpy simd.inc.src on github.
Take a look at basic example
import numpy as np
x = np.array([1, 2, 3], np.int32)
print (type(x))
y = np.array([6, 7, 8], np.int32)
print (type(y))
Now we are adding up these two arrays
z=x+y
print (z)
print (type(z))
As a result we have
<class 'numpy.ndarray'>
<class 'numpy.ndarray'>
[ 7 9 11]
<class 'numpy.ndarray'>
Vectorised,yes they are.But the term vector has different meaning in mathematics and physics,and we are using arrays as mathematical abstraction.