MAINT: Quick and dirty working set of symbols

Well working as in has enough symbols for the import, currently is
failing NumPy tests, including dot matrix multiplications...
This commit is contained in:
Rohit Goswami 2024-05-27 03:00:08 +00:00 committed by Mateusz Sokół
parent 891052a3ef
commit 86aa6b3a87
3 changed files with 112 additions and 6 deletions

86
driver/others/meson.build Normal file
View File

@ -0,0 +1,86 @@
# Define the operations and their sources
others_ops = [
{ 'base': 'memory', 'source': 'memory.c' },
{ 'base': 'xerbla', 'source': 'xerbla.c' },
{ 'base': 'openblas_set_num_threads', 'source': 'openblas_set_num_threads.c' },
{ 'base': 'openblas_get_num_threads', 'source': 'openblas_get_num_threads.c', 'addl': [
'-O2', '-DSMALL_MATRIX_OPT', '-DMAX_PARALLEL_NUMBER=1', '-DMAX_STACK_ALLOC=2048', '-Wall', '-DF_OTHERS_GFORT',
'-fPIC', '-DSMP_SERVER', '-DNO_WARMUP', '-DMAX_CPU_NUMBER=12', '-DVERSION="0.3.26.dev"', '-msse3', '-mssse3',
'-msse4.1', '-mavx', '-mavx2'
]},
{ 'base': 'openblas_get_num_procs', 'source': 'openblas_get_num_procs.c' },
{ 'base': 'openblas_get_parallel', 'source': 'openblas_get_parallel.c' },
{ 'base': 'openblas_error_handle', 'source': 'openblas_error_handle.c' },
{ 'base': 'openblas_env', 'source': 'openblas_env.c' },
{ 'base': 'blas_server', 'source': 'blas_server.c' },
{ 'base': 'divtable', 'source': 'divtable.c', 'addl': ['-UDOUBLE'] },
{ 'base': 'blasL1thread', 'source': 'blas_l1_thread.c' },
{ 'base': 'parameter', 'source': 'parameter.c' }
]
# Initialize configurations list
others_confs = []
# Iterate through each operation
foreach op : others_ops
base = op['base']
source = op['source']
addl = op.get('addl', [])
# Generate the symbol flags
ckop_args = []
if symb_defs.has_key(base)
symb_base = symb_defs[base]
if symb_base.has_key('def')
foreach d : symb_base['def']
ckop_args += ['-D' + d]
endforeach
endif
if symb_base.has_key('undef')
foreach u : symb_base['undef']
ckop_args += ['-U' + u]
endforeach
endif
endif
# Default compilation arguments
c_args = _cargs + ckop_args + addl
# Generate the symbol name
sym_name = base
sym_underscored = '@0@_'.format(sym_name)
# Add standard flags for naming conventions
c_args += [
'-DASMNAME=@0@'.format(sym_name),
'-DASMFNAME=@0@_'.format(sym_name),
'-DNAME=@0@_'.format(sym_name),
'-DCNAME=@0@'.format(sym_name),
'-DCHAR_NAME="@0@_"'.format(sym_name),
'-DCHAR_CNAME="@0@"'.format(sym_name)
]
# Append the current configuration
current_def = {
'c_args': c_args,
'name': sym_name,
'src': [source]
}
others_confs += [current_def]
endforeach
# Create the static libraries from the configurations
others_libs = []
foreach conf : others_confs
message(conf['name'])
message(conf)
others_libs += [static_library(
conf['name'],
conf['src'],
include_directories: _inc,
c_args: conf['c_args']
)]
endforeach
# Create the final interface library
_others = static_library('_interface', link_whole: others_libs)

View File

@ -72,6 +72,18 @@ base_kops = [
'x': {'exts': {'_k': {'dir': 'x86_64', 'kernel': 'zdot.S'}}},
},
},
{ 'base': '?dotc',
'modes': {
'c': {'exts': {'_k': {'dir': 'x86_64', 'kernel': 'cdot.c'}}},
'z': {'exts': {'_k': {'dir': 'x86_64', 'kernel': 'zdot.c'}}},
},
},
{ 'base': '?dotu',
'modes': {
'c': {'exts': {'_k': {'dir': 'x86_64', 'kernel': 'cdot.c'}}},
'z': {'exts': {'_k': {'dir': 'x86_64', 'kernel': 'zdot.c'}}},
},
},
# TODO(rg): Add dsdotkernel conditionals
# xDOTU xDOTC xxDOT aren't present
{ 'base': '?nrm2',
@ -501,6 +513,8 @@ base_kops = [
'modes': {
's': {'exts': {
'_beta': {'dir': 'generic', 'kernel': 'gemm_beta.c'},
'_small_matrix_permit': {'dir': 'generic',
'kernel': 'gemm_small_matrix_permit.c'},
# TODO(rg): the _NUM prefixes are arch dependent
'_incopy': {'dir': 'generic', 'kernel': 'gemm_ncopy_8.c'},
'_itcopy': {'dir': 'generic', 'kernel': 'gemm_tcopy_8.c'},
@ -512,6 +526,8 @@ base_kops = [
}},
'd': {'exts': {
'_beta': {'dir': 'generic', 'kernel': 'gemm_beta.c'},
'_small_matrix_permit': {'dir': 'generic',
'kernel': 'gemm_small_matrix_permit.c'},
'_incopy': {'dir': 'generic', 'kernel': 'gemm_ncopy_8.c'},
'_itcopy': {'dir': 'generic', 'kernel': 'gemm_tcopy_8.c'},
'_oncopy': {'dir': 'generic', 'kernel': 'gemm_ncopy_2.c'},
@ -519,6 +535,8 @@ base_kops = [
}},
'c': {'exts': {
'_beta': {'dir': 'generic', 'kernel': 'zgemm_beta.c'},
'_small_matrix_permit': {'dir': 'generic',
'kernel': 'zgemm_small_matrix_permit.c'},
'_incopy': {'dir': 'generic', 'kernel': 'zgemm_ncopy_8.c'},
'_itcopy': {'dir': 'generic', 'kernel': 'zgemm_tcopy_8.c'},
'_oncopy': {'dir': 'generic', 'kernel': 'zgemm_ncopy_2.c'},
@ -526,6 +544,8 @@ base_kops = [
}},
'z': {'exts': {
'_beta': {'dir': 'generic', 'kernel': 'zgemm_beta.c'},
'_small_matrix_permit': {'dir': 'generic',
'kernel': 'zgemm_small_matrix_permit.c'},
'_incopy': {'dir': 'generic', 'kernel': 'zgemm_ncopy_8.c'},
'_itcopy': {'dir': 'generic', 'kernel': 'zgemm_tcopy_8.c'},
'_oncopy': {'dir': 'generic', 'kernel': 'zgemm_ncopy_2.c'},
@ -1003,8 +1023,8 @@ endforeach
_kern_libs = []
foreach conf: kernel_confs
message(conf['name'])
message(conf)
# message(conf['name'])
# message(conf)
_kern_libs += static_library(
conf['name'],
conf['src'],

View File

@ -26,7 +26,7 @@ fc_id = fc.get_id()
# Common args
_args = []
_cargs = []
_cargs = ['-DMAX_PARALLEL_NUMBER=1']
_fargs = []
# System configuration
@ -442,9 +442,9 @@ _inc = [include_directories('.')]
subdir('interface')
subdir('driver/level2')
subdir('driver/level3')
# subdir('driver/others')
subdir('driver/others')
subdir('kernel')
_openblas = static_library('openblas',
link_whole: [ _interface, _l2_driver, _l3_driver, _kern ],
install: true)
link_whole: [ _interface, _l2_driver, _l3_driver, _others, _kern ],
install: true)