Changeset 880a2ed in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Sep 5, 2016 7:15:21 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:
27fc92f
Parents:
fe77343
Message:

Handling for SAS_OPENCL enviromental variable added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    rfe77343 r880a2ed  
    2121from . import kernelpy 
    2222from . import kerneldll 
    23 try: 
    24     from . import kernelcl 
    25     HAVE_OPENCL = True 
    26 except Exception: 
     23 
     24if "SAS_OPENCL" not in os.environ: 
    2725    HAVE_OPENCL = False 
     26else: 
     27    try: 
     28        from . import kernelcl 
     29        HAVE_OPENCL = True 
     30    except Exception: 
     31        HAVE_OPENCL = False 
    2832 
    2933try: 
     
    219223    # Assign default platform, overriding ocl with dll if OpenCL is unavailable 
    220224    # If opencl=False OpenCL is switched off 
    221     # Finally one can force OpenCL calculation even if HAVE_OPENCL=False 
    222  
    223     if "SAS_OPENCL" in os.environ: 
    224         sasopencl = os.environ["SAS_OPENCL"] 
    225225 
    226226    if platform is None: 
     
    228228    if platform == "ocl" and not HAVE_OPENCL or not model_info.opencl: 
    229229        platform = "dll" 
    230     #if  model_info.opencl and not HAVE_OPENCL: 
    231     #    platform = "ocl" 
    232230 
    233231    # Check if type indicates dll regardless of which platform is given 
Note: See TracChangeset for help on using the changeset viewer.