Are numpy's basic operations vectorized, i.e. do they use SIMD operations?

后端 未结 2 1289
说谎
说谎 2020-11-30 07:36

I am doing some performance analysis, and i wonder, whether numpy vectorizes its standard array operations, when the datatype is known (double).



        
2条回答
  •  感情败类
    2020-11-30 08:13

    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.

提交回复
热议问题