sparse.generate_sparsetools

python generate_sparsetools.py

Generate manual wrappers for C++ sparsetools code.

Type codes used:

’i’: integer scalar ‘I’: integer array ‘T’: data array ‘B’: boolean array ‘V’: std::vector<integer>* ‘W’: std::vector<data>* ‘*’: indicates that the next argument is an output argument ‘v’: void

See sparsetools.cxx for more details.

Module Contents

Functions

get_thunk_type_set() Get a list containing cartesian product of data types, plus a getter routine.
parse_routine(name,args,types) Generate thunk and method code for a given routine.
main()
write_autogen_blurb(stream)
get_thunk_type_set()

Get a list containing cartesian product of data types, plus a getter routine.

i_types : list [(j, I_typenum, None, I_type, None), …]
Pairing of index type numbers and the corresponding C++ types, and an unique index j. This is for routines that are parameterized only by I but not by T.
it_types : list [(j, I_typenum, T_typenum, I_type, T_type), …]
Same as i_types, but for routines parameterized both by T and I.
getter_code : str
C++ code for a function that takes I_typenum, T_typenum and returns the unique index corresponding to the lists, or -1 if no match was found.
parse_routine(name, args, types)

Generate thunk and method code for a given routine.

name : str
Name of the C++ routine
args : str
Argument list specification (in format explained above)
types : list
List of types to instantiate, as returned get_thunk_type_set
main()
write_autogen_blurb(stream)