[Numpy-svn] [numpy/numpy] e2eaf9: BUG: Ugly fix for Apple's cblas_sgemv segfault

GitHub noreply at github.com
Sun Oct 26 12:18:18 EDT 2014


  Branch: refs/heads/maintenance/1.9.x
  Home:   https://github.com/numpy/numpy
  Commit: e2eaf961dff8d57e3c12c19c39956a40754a1d0e
      https://github.com/numpy/numpy/commit/e2eaf961dff8d57e3c12c19c39956a40754a1d0e
  Author: Sturla Molden <sturla at molden.no>
  Date:   2014-10-23 (Thu, 23 Oct 2014)

  Changed paths:
    A numpy/core/blasdot/apple_sgemv_patch.c
    M numpy/core/setup.py
    M numpy/core/tests/test_blasdot.py
    M numpy/distutils/system_info.py

  Log Message:
  -----------
  BUG: Ugly fix for Apple's cblas_sgemv segfault

SGEMV in Accelerate framework will segfault on MacOS X version 10.9
(aka Mavericks) if arrays are not aligned to 32 byte boundaries
and the CPU supports AVX instructions. This can produce segfaults
in numpy.dot if we use numpy.float32 as dtype. This patch overshadows
the symbols cblas_sgemv, sgemv_ and sgemv exported by Accelerate
to produce the correct behavior. The MacOS X version and CPU specs
are checked on module import. If Mavericks and AVX are detected
the call to SGEMV is emulated with a call to SGEMM if the arrays
are not 32 byte aligned. If the exported symbols cannot be
overshadowed on module import, a fatal error is produced and the
process aborts. All the fixes are in a self-contained C file
and do not alter the _dotblas C code. The patch is not applied
unless NumPy is configured to link with Apple's Accelerate
framework.


  Commit: a373392d64eadca4e253eb5707a56e9db93e4e76
      https://github.com/numpy/numpy/commit/a373392d64eadca4e253eb5707a56e9db93e4e76
  Author: Julian Taylor <juliantaylor108 at gmail.com>
  Date:   2014-10-26 (Sun, 26 Oct 2014)

  Changed paths:
    A numpy/core/blasdot/apple_sgemv_patch.c
    M numpy/core/setup.py
    M numpy/core/tests/test_blasdot.py
    M numpy/distutils/system_info.py

  Log Message:
  -----------
  Merge pull request #5223 from sturlamolden/accelerate-sgemv-fix

BUG: Ugly fix for Apple's cblas_sgemv segfault


Compare: https://github.com/numpy/numpy/compare/15a20970152d...a373392d64ea


More information about the Numpy-svn mailing list