Changeset e59f60a in sasmodels


Ignore:
Timestamp:
Jan 27, 2018 7:00:35 PM (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:
f354e46
Parents:
6dba2f0
Message:

py.test needs kernelcl import to succeed even if pyopencl is not available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r6dba2f0 re59f60a  
    5858import numpy as np  # type: ignore 
    5959 
    60 import pyopencl as cl  # type: ignore 
    61 from pyopencl import mem_flags as mf 
    62 from pyopencl.characterize import get_fast_inaccurate_build_options 
    63  
    6460try: 
    6561    if os.environ.get("SAS_OPENCL", "").lower() == "none": 
    6662        HAVE_OPENCL = False 
    6763    else: 
     64        import pyopencl as cl  # type: ignore 
     65        from pyopencl import mem_flags as mf 
     66        from pyopencl.characterize import get_fast_inaccurate_build_options 
    6867        # Ask OpenCL for the default context so that we know that one exists 
    6968        cl.create_some_context(interactive=False) 
Note: See TracChangeset for help on using the changeset viewer.