diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-03-02 22:05:05 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-03-02 22:24:10 +0000 |
commit | 71898246d4287d33d294a7a47cd6bafacc3d376f (patch) | |
tree | b810ef473d43ddbacd578c067dcfdc423b4c6b59 /numpy/linalg/lapack_lite/make_lite.py | |
parent | 9c09f0105b6a62c0dfe9167fa78c0fb59878e222 (diff) | |
download | numpy-71898246d4287d33d294a7a47cd6bafacc3d376f.tar.gz |
MAINT: Split up the lapack_lite files more sensibly
Also uses this splitting as an excuse to ditch the _lite suffix, in
favor of a f2c_ prefix for all generated files.
Before:
* `zlapack_lite.c` - Functions for the `complex128` type.
* `dlapack_lite.c` - Every other lapack function
After:
* `f2c_z_lapack.c` - Functions for the `complex128` type.
* `f2c_c_lapack.c` - Functions for the `complex64` type.
* `f2c_d_lapack.c` - Functions for the `float64` type.
* `f2c_s_lapack.c` - Functions for the `float32` type.
* `f2c_lapack.c` - Every other lapack function
Diffstat (limited to 'numpy/linalg/lapack_lite/make_lite.py')
-rwxr-xr-x | numpy/linalg/lapack_lite/make_lite.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/numpy/linalg/lapack_lite/make_lite.py b/numpy/linalg/lapack_lite/make_lite.py index 2126f267f..b8f1ac89c 100755 --- a/numpy/linalg/lapack_lite/make_lite.py +++ b/numpy/linalg/lapack_lite/make_lite.py @@ -24,7 +24,7 @@ import clapack_scrub # -C to check array subscripts F2C_ARGS = ['-A'] -# The header to add to the top of the *_lite.c file. Note that dlamch_() calls +# The header to add to the top of the f2c_*.c file. Note that dlamch_() calls # will be replaced by the macros below by clapack_scrub.scrub_source() HEADER = '''\ /* @@ -164,12 +164,18 @@ class FortranLibrary(object): class LapackLibrary(FortranLibrary): def _newFortranRoutine(self, rname, filename): routine = FortranLibrary._newFortranRoutine(self, rname, filename) - if 'BLAS' in filename: + if 'blas' in filename.lower(): routine.type = 'blas' elif rname.startswith('z'): - routine.type = 'zlapack' + routine.type = 'z_lapack' + elif rname.startswith('c'): + routine.type = 'c_lapack' + elif rname.startswith('s'): + routine.type = 's_lapack' + elif rname.startswith('d'): + routine.type = 'd_lapack' else: - routine.type = 'dlapack' + routine.type = 'lapack' return routine def allRoutinesByType(self, typename): @@ -216,7 +222,7 @@ def getWrappedRoutineNames(wrapped_routines_file): routines.append(line) return routines, ignores -types = {'blas', 'zlapack', 'dlapack'} +types = {'blas', 'lapack', 'd_lapack', 's_lapack', 'z_lapack', 'c_lapack'} def dumpRoutineNames(library, output_dir): for typename in {'unknown'} | types: @@ -267,7 +273,7 @@ def main(): dumpRoutineNames(library, output_dir) for typename in types: - fortran_file = os.path.join(output_dir, '%s_lite.f' % typename) + fortran_file = os.path.join(output_dir, 'f2c_%s.f' % typename) c_file = fortran_file[:-2] + '.c' print('creating %s ...' % c_file) routines = library.allRoutinesByType(typename) |