BLD: Rewrite more of the interface
This commit is contained in:
parent
85db158f02
commit
62123d0491
|
@ -5,21 +5,13 @@ if get_option('exprecision')
|
||||||
endif
|
endif
|
||||||
complex_kinds = ['c', 'z', 'x']
|
complex_kinds = ['c', 'z', 'x']
|
||||||
extended_kinds = ['dx', 'bf16']
|
extended_kinds = ['dx', 'bf16']
|
||||||
_rules = {
|
|
||||||
's': ['FLOAT'],
|
|
||||||
'd': ['DOUBLE'],
|
|
||||||
'q': ['QUAD_PRECISION'],
|
|
||||||
'c': ['COMPLEX'],
|
|
||||||
'dx': ['XDOUBLE'],
|
|
||||||
'bf19': ['BFLOAT16'],
|
|
||||||
}
|
|
||||||
|
|
||||||
blas_roots = []
|
blas_roots = []
|
||||||
blas1_roots = [
|
blas1_roots = [
|
||||||
# These don't exist as roots.
|
# These don't exist as roots.
|
||||||
# ismax amax isamax amin ismin isamin
|
# ismax amax isamax amin ismin isamin
|
||||||
# TODO: Why is dsdot in sblas1objs!?
|
# TODO: Why is dsdot in sblas1objs!?
|
||||||
# 'axpy', 'swap', 'copy', 'scal', 'dot', 'dsdot', 'asum', 'sum', 'nrm2', 'max',
|
'axpy', 'swap', 'copy', 'scal', 'dot', 'dsdot', 'asum', 'sum', 'nrm2', 'max',
|
||||||
'rot'#, 'rotg', 'rotm', 'rotmg', 'axpby',
|
'rot'#, 'rotg', 'rotm', 'rotmg', 'axpby',
|
||||||
]
|
]
|
||||||
blas2_roots = [
|
blas2_roots = [
|
||||||
|
@ -32,6 +24,153 @@ blas3_roots = [
|
||||||
'gemmt'
|
'gemmt'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
_blas_roots = [
|
||||||
|
# Level 1
|
||||||
|
{ 'base': '?asum', '_types': ['s', 'd', 'q', 'sc', 'dz', 'qx'],
|
||||||
|
'fname': 'asum.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?sum', '_types': ['s', 'd', 'q', 'sc', 'dz', 'qx'],
|
||||||
|
'fname': 'sum.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?amax', '_types': ['s', 'd', 'q', 'sc', 'dz', 'qx'],
|
||||||
|
'fname': 'max.c', 'def': [ 'USE_ABS' ], 'undef': [ 'USE_MIN' ],
|
||||||
|
},
|
||||||
|
{ 'base': '?amin', '_types': ['s', 'd', 'q', 'sc', 'dz', 'qx'],
|
||||||
|
'fname': 'max.c', 'def': [ 'USE_ABS', 'USE_MIN' ], 'undef': [ ],
|
||||||
|
},
|
||||||
|
{ 'base': '?max', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'max.c', 'def': [ ], 'undef': [ 'USE_ABS', 'USE_MIN' ],
|
||||||
|
},
|
||||||
|
{ 'base': '?min', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'max.c', 'def': [ 'USE_MIN' ], 'undef': [ 'USE_ABS' ],
|
||||||
|
},
|
||||||
|
{ 'base': '?axpy', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'axpy.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?axpy', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zaxpy.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?axpyc', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zaxpy.c', 'def': [ 'CONJ' ], 'undef': [ ],
|
||||||
|
},
|
||||||
|
{ 'base': '?copy', '_types': ['s', 'd', 'q', 'c', 'z', 'x'],
|
||||||
|
'fname': 'copy.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?dot', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'dot.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?dotu', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zdot.c', 'def': [ ], 'undef': [ 'CONJ' ],
|
||||||
|
},
|
||||||
|
{ 'base': '?dotc', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zdot.c', 'def': [ 'CONJ' ], 'undef': [ ],
|
||||||
|
},
|
||||||
|
{ 'base': '?nrm2', '_types': ['s', 'd', 'q', 'sc', 'dz', 'qx'],
|
||||||
|
'fname': 'nrm2.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?rot', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'rot.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?rot', '_types': ['cs', 'zd', 'xq'],
|
||||||
|
'fname': 'zrot.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?rotm', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'rotm.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?rotmg', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'rotmg.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?rotg', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'rotg.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?rotg', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zrotg.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?scal', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'scal.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?scal', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zscal.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?scal', '_types': ['cs', 'zd', 'xq'],
|
||||||
|
'fname': 'zscal.c', 'def': [ 'SSCAL' ], 'undef': [ ],
|
||||||
|
},
|
||||||
|
{ 'base': '?swap', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'swap.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?swap', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zswap.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?dsdot', '_types': ['s'],
|
||||||
|
'fname': 'sdsdot.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?dsdot', '_types': [''],
|
||||||
|
'fname': 'dsdot.c',
|
||||||
|
},
|
||||||
|
# TODO: Handle BFLOAT16 Makefile 784:795
|
||||||
|
{ 'base': 'i?max', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'imax.c', 'def': [ ], 'undef': [ 'USE_ABS', 'USE_MIN' ],
|
||||||
|
},
|
||||||
|
{ 'base': 'i?amax', '_types': ['s', 'd', 'q', 'c', 'z', 'x'],
|
||||||
|
'fname': 'imax.c', 'def': [ 'USE_ABS' ], 'undef': [ 'USE_MIN' ],
|
||||||
|
},
|
||||||
|
{ 'base': 'i?amin', '_types': ['s', 'd', 'c', 'z', 'x'],
|
||||||
|
'fname': 'imax.c', 'def': [ 'USE_ABS', 'USE_MIN' ], 'undef': [ ],
|
||||||
|
},
|
||||||
|
{ 'base': 'i?min', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'imax.c', 'def': [ 'USE_MIN' ], 'undef': [ 'USE_ABS' ],
|
||||||
|
},
|
||||||
|
# Level 2
|
||||||
|
{ 'base': '?ger', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'ger.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?geru', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zger.c', 'def': [ ], 'undef': [ 'CONJ' ],
|
||||||
|
},
|
||||||
|
{ 'base': '?gerc', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zger.c', 'def': [ 'CONJ' ], 'undef': [ ],
|
||||||
|
},
|
||||||
|
# TODO: Handle BFLOAT16 Makefile 941:944
|
||||||
|
# TODO: Handle Netlib_gemv Makefile 946:958
|
||||||
|
{ 'base': '?gemv', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'gemv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?gemv', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zgemv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?trmv', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'trmv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?trmv', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'ztrmv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?trsv', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'trsv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?trsv', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'ztrsv.c',
|
||||||
|
},
|
||||||
|
# TODO: Handle NO_LAPACK
|
||||||
|
{ 'base': '?symv', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'symv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?symv', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zsymv.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?syr', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'syr.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?syr', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zsyr.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?syr2', '_types': ['s', 'd', 'q'],
|
||||||
|
'fname': 'syr2.c',
|
||||||
|
},
|
||||||
|
{ 'base': '?syr2', '_types': ['c', 'z', 'x'],
|
||||||
|
'fname': 'zsyr2.c',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
# addl_srcs = {
|
# addl_srcs = {
|
||||||
# 'symm': '-DHEMM'
|
# 'symm': '-DHEMM'
|
||||||
# }
|
# }
|
||||||
|
|
|
@ -252,6 +252,9 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Common maps
|
# Common maps
|
||||||
|
# Naming conventions: https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2024-1/naming-conventions-for-blas-routines.html
|
||||||
|
# Also see:
|
||||||
|
# L1: https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2024-1/blas-level-1-routines-and-functions.html
|
||||||
precision_mappings = {
|
precision_mappings = {
|
||||||
's': {'undef': ['COMPLEX', 'DOUBLE'], 'def': []},
|
's': {'undef': ['COMPLEX', 'DOUBLE'], 'def': []},
|
||||||
'd': {'undef': ['COMPLEX'], 'def': ['DOUBLE']},
|
'd': {'undef': ['COMPLEX'], 'def': ['DOUBLE']},
|
||||||
|
@ -259,6 +262,9 @@ precision_mappings = {
|
||||||
'c': {'undef': ['DOUBLE'], 'def': ['COMPLEX']},
|
'c': {'undef': ['DOUBLE'], 'def': ['COMPLEX']},
|
||||||
'z': {'undef': [], 'def': ['COMPLEX', 'DOUBLE']},
|
'z': {'undef': [], 'def': ['COMPLEX', 'DOUBLE']},
|
||||||
'x': {'undef': [], 'def': ['COMPLEX', 'XDOUBLE']},
|
'x': {'undef': [], 'def': ['COMPLEX', 'XDOUBLE']},
|
||||||
|
'cs': {'undef': ['DOUBLE'], 'def': ['COMPLEX']},
|
||||||
|
# zd is the same as z
|
||||||
|
# 'zd': {'undef': [], 'def': ['COMPLEX', 'DOUBLE']},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ignoring other hostarch checks and conflicts for arch in BSD for now
|
# Ignoring other hostarch checks and conflicts for arch in BSD for now
|
||||||
|
|
Loading…
Reference in New Issue