hr0*_*r0m 13 python numpy python-3.x
我正在做一些性能分析,我想知道numpy,当数据类型已知时(双倍)是否矢量化其标准数组操作.
a, b = (some numpy arrays)
c = a + b #Is this vectorized?
Run Code Online (Sandbox Code Playgroud)
编辑:此操作是否已向量化,即计算是否包含SIMD操作?
hen*_*oem 21
对,他们是.
/*
* 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.
*/
Run Code Online (Sandbox Code Playgroud)
链接:github上的Numpy simd.inc.src.
| 归档时间: |
|
| 查看次数: |
4098 次 |
| 最近记录: |