Changeset 3221de0 in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Feb 1, 2018 9:40:30 AM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
b4272a2
Parents:
b3af1c2
Message:

restructure handling of opencl flags so it works with sasview

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r6dba2f0 r3221de0  
    2525from . import custom 
    2626 
    27 # Other modules look for HAVE_OPENCL in core, not in kernelcl. 
    28 HAVE_OPENCL = kernelcl.HAVE_OPENCL 
    29  
    30 CUSTOM_MODEL_PATH = os.environ.get('SAS_MODELPATH', "") 
    31 if CUSTOM_MODEL_PATH == "": 
    32     CUSTOM_MODEL_PATH = joinpath(os.path.expanduser("~"), ".sasmodels", "custom_models") 
    33     if not os.path.isdir(CUSTOM_MODEL_PATH): 
    34         os.makedirs(CUSTOM_MODEL_PATH) 
    35  
    3627# pylint: disable=unused-import 
    3728try: 
     
    4233    pass 
    4334# pylint: enable=unused-import 
     35 
     36CUSTOM_MODEL_PATH = os.environ.get('SAS_MODELPATH', "") 
     37if CUSTOM_MODEL_PATH == "": 
     38    CUSTOM_MODEL_PATH = joinpath(os.path.expanduser("~"), ".sasmodels", "custom_models") 
     39    if not os.path.isdir(CUSTOM_MODEL_PATH): 
     40        os.makedirs(CUSTOM_MODEL_PATH) 
    4441 
    4542# TODO: refactor composite model support 
     
    271268    if platform is None: 
    272269        platform = "ocl" 
    273     if platform == "ocl" and not HAVE_OPENCL or not model_info.opencl: 
     270    if not kernelcl.use_opencl() or not model_info.opencl: 
    274271        platform = "dll" 
    275272 
Note: See TracChangeset for help on using the changeset viewer.