Changeset fbcee4f


Ignore:
Timestamp:
Apr 25, 2016, 12:35:53 AM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
c4b2183
Parents:
c6388f4
Message:

python/lib/gen_{external,code}.py: prepare for double precision

Location:
python/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_code.py

    rc6388f4 rfbcee4f  
    6969
    7070pyargparse_chars = {
    71         'smpl_t': 'f',
     71        'smpl_t': 'f', # if not usedouble else 'd',
    7272        'uint_t': 'I',
    7373        'sint_t': 'I',
     
    154154class MappedObject(object):
    155155
    156     def __init__(self, prototypes):
     156    def __init__(self, prototypes, usedouble = False):
     157        if usedouble:
     158            pyargparse_chars['smpl_t'] = 'd'
    157159        self.prototypes = prototypes
    158160
  • python/lib/gen_external.py

    rc6388f4 rfbcee4f  
    6767    return cpp_output, cpp_objects
    6868
    69 def generate_external(output_path):
    70     os.mkdir(output_path)
     69def generate_external(output_path, usedouble = False):
     70    if not os.path.isdir(output_path): os.mkdir(output_path)
    7171    sources_list = []
    7272    cpp_output, cpp_objects = get_cpp_objects()
     
    124124    for o in lib:
    125125        out = header
    126         mapped = MappedObject(lib[o])
     126        mapped = MappedObject(lib[o], usedouble = usedouble)
    127127        out += mapped.gen_code()
    128128        output_file = os.path.join(output_path, 'gen-%s.c' % o)
Note: See TracChangeset for help on using the changeset viewer.