Changeset 407bf48 in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Aug 24, 2016 5:19:52 AM (8 years ago)
Author:
wojciech
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:
8407d8c
Parents:
0dc34c3
Message:

gpu flag added to sasmodels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r725ee36 r407bf48  
    4646#    build_model 
    4747 
    48 KINDS = ("all", "py", "c", "double", "single", "1d", "2d", 
     48KINDS = ("all", "py", "c", "double", "single", "gpu", "1d", "2d", 
    4949         "nonmagnetic", "magnetic") 
    5050def list_models(kind=None): 
     
    6060        * single: models which support single precision 
    6161        * double: models which require double precision 
     62        * gpu: models which compiles on GPU 
    6263        * 1d: models which are 1D only, or 2D using abs(q) 
    6364        * 2d: models which can be 2D 
     
    8586        return True 
    8687    elif kind == "single" and info.single: 
     88        return True 
     89    elif kind == "gpu" and info.gpu: 
    8790        return True 
    8891    elif kind == "2d" and any(p.type == 'orientation' for p in pars): 
     
    215218    """ 
    216219    # Assign default platform, overriding ocl with dll if OpenCL is unavailable 
     220    # If gpu=False OpenCL is switched off 
    217221    if platform is None: 
    218222        platform = "ocl" 
    219     if platform == "ocl" and not HAVE_OPENCL: 
     223    if platform == "ocl" and not HAVE_OPENCL or not model_info.gpu: 
    220224        platform = "dll" 
    221225 
Note: See TracChangeset for help on using the changeset viewer.