Skip to content

Commit

Permalink
Merge pull request #1190 from kohr-h/issue-1189__blas_bigint
Browse files Browse the repository at this point in the history
BUG: disable BLAS for too large arrays (int overflow), closes #1189
  • Loading branch information
adler-j authored Oct 19, 2017
2 parents 460d564 + 9c4979e commit c9c5acf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion odl/space/npy_ntuples.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ def _blas_is_applicable(*args):
float or complex data only. If the arrays are non-contiguous,
BLAS methods are usually slower, and array-writing routines do
not work at all. Hence, only contiguous arrays are allowed.
Furthermore, BLAS uses 32-bit integers internally for indexing,
which makes it unusable for arrays lager than ``2 ** 31 - 1``.
Parameters
----------
Expand All @@ -476,7 +478,8 @@ def _blas_is_applicable(*args):
"""
return (all(x.dtype == args[0].dtype and
x.dtype in _BLAS_DTYPES and
x.data.flags.contiguous
x.data.flags.contiguous and
x.size <= np.iinfo('int32').max
for x in args))


Expand Down

0 comments on commit c9c5acf

Please sign in to comment.