Changeset 5d316e9 in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Dec 8, 2015 6:08:51 AM (8 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/core.py

    r9404dd3 r5d316e9  
    6565    return True 
    6666 
    67 def load_model(model_definition, dtype="single", platform="ocl"): 
     67def load_model(model_definition, dtype="single", platform="ocl", fast=False): 
    6868    """ 
    6969    Prepare the model for the default execution platform. 
     
    8383    *platform* should be "dll" to force the dll to be used for C models, 
    8484    otherwise it uses the default "ocl". 
     85 
     86    *fast* is True if fast inaccurate math is acceptable (40% speed increase). 
    8587    """ 
    8688    if isstr(model_definition): 
     
    102104    if (platform=="dll" 
    103105            or not HAVE_OPENCL 
    104             or (dtype == np.float64 and not kernelcl.environment().has_double)): 
     106            or not kernelcl.environment().has_type(dtype)): 
    105107        return kerneldll.load_dll(source, info, dtype) 
    106108    else: 
    107         return kernelcl.GpuModel(source, info, dtype) 
     109        return kernelcl.GpuModel(source, info, dtype, fast) 
    108110 
    109111def make_kernel(model, q_vectors): 
Note: See TracChangeset for help on using the changeset viewer.