Changeset 5d316e9 in sasmodels for sasmodels/kerneldll.py


Ignore:
Timestamp:
Dec 8, 2015 8:08:51 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
cf404cb
Parents:
eaca9eb
Message:

support fast and loose single precision and half precision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    r9404dd3 r5d316e9  
    8585DLL_PATH = tempfile.gettempdir() 
    8686 
    87 ALLOW_SINGLE_PRECISION_DLLS = False 
     87ALLOW_SINGLE_PRECISION_DLLS = True 
    8888 
    8989 
     
    122122    models are allowed as DLLs. 
    123123    """ 
     124    if callable(info.get('Iq',None)): 
     125        return PyModel(info) 
     126 
    124127    dtype = np.dtype(dtype) 
     128    if dtype == generate.F16: 
     129        raise ValueError("16 bit floats not supported") 
    125130    if dtype == generate.F32 and not ALLOW_SINGLE_PRECISION_DLLS: 
    126131        dtype = generate.F64  # Force 64-bit dll 
    127132 
    128     if callable(info.get('Iq',None)): 
    129         return PyModel(info) 
    130  
    131133    if dtype == generate.F32: # 32-bit dll 
    132         source = generate.use_single(source) 
    133134        tempfile_prefix = 'sas_'+info['name']+'32_' 
    134135    elif dtype == generate.F64: 
    135136        tempfile_prefix = 'sas_'+info['name']+'64_' 
    136137    else: 
    137         source = generate.use_long_double(source) 
    138138        tempfile_prefix = 'sas_'+info['name']+'128_' 
    139139 
     140    source = generate.convert_type(source, dtype) 
    140141    source_files = generate.sources(info) + [info['filename']] 
    141142    dll= dll_path(info, dtype) 
Note: See TracChangeset for help on using the changeset viewer.