How can I check if my installed numpy is compiled with SSE/SSE2 instruction set?

前端 未结 3 469
粉色の甜心
粉色の甜心 2020-12-28 10:43

How can I check if my installed version of numpy is compiled with SSE/SSE2 instruction set? I know that some parts of numpy is using BLAS, how to check BLAS too?

3条回答
  •  死守一世寂寞
    2020-12-28 11:26

    I think that one way is to use objdump on a numpy.so file if you are under linux, and grep for instruction that are specific to sse.

    for SSE3 (http://en.wikipedia.org/wiki/SSE3) :

    objdump -d  /usr/lib/pyshared/python2.7/numpy/core/*.so | grep -i MOVDDUP
    

    for SSE2 (http://fr.wikipedia.org/wiki/Jeu_d%27instructions_x86#Instructions_SSE2) :

    objdump -d  /usr/lib/pyshared/python2.7/numpy/core/*.so | grep -i ADDPD
    

    if you get some results with the grep it means that the binary has been compiled with the SSE flags.

提交回复
热议问题