forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scipy#9455 from ilayn/get_lapack_func_clnup
MAINT: Speed up get_(lapack,blas)_func
- Loading branch information
Showing
2 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from __future__ import division, absolute_import, print_function | ||
|
||
import numpy as np | ||
|
||
try: | ||
import scipy.linalg.lapack as la | ||
import scipy.linalg.blas as bla | ||
except ImportError: | ||
pass | ||
|
||
from .common import Benchmark | ||
|
||
|
||
class GetBlasLapackFuncs(Benchmark): | ||
""" | ||
Test the speed of grabbing the correct BLAS/LAPACK routine flavor. | ||
In particular, upon receiving strange dtype arrays the results shouldn't | ||
diverge too much. Hence the results here should be comparable | ||
""" | ||
|
||
param_names = ['dtype1', 'dtype2', | ||
'dtype1_ord', 'dtype2_ord', | ||
'size'] | ||
params = [ | ||
['b', 'G', 'd'], | ||
['d', 'F', '?'] | ||
['C', 'F'], | ||
['C', 'F'], | ||
[10, 100, 1000] | ||
] | ||
|
||
def setup(self, dtype1, dtype2, dtype1_ord, dtype2_ord, size): | ||
self.arr1 = np.empty(size, dtype=dtype1, order=dtype1_ord) | ||
self.arr2 = np.empty(size, dtype=dtype2, order=dtype2_ord) | ||
|
||
def time_find_best_blas_type(self, arr1, arr2): | ||
prefix, dtype, prefer_fortran = bla.find_best_blas_type((arr1, arr2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters