Changeset 7841376 in sasmodels


Ignore:
Timestamp:
Feb 19, 2015 8:32:18 AM (10 years ago)
Author:
wimbouwman
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:
afb2c78
Parents:
c5ad743
Message:

handle the case where opencl is installed but has no devices available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r87fce00 r7841376  
    3333    warnings.warn(str(exc)) 
    3434    raise RuntimeError("OpenCL not available") 
     35 
     36try: 
     37    context = cl.create_some_context(interactive=False) 
     38    del context 
     39except cl.RuntimeError, exc: 
     40    warnings.warn(str(exc)) 
     41    raise RuntimeError("OpenCl not available") 
    3542 
    3643from pyopencl import mem_flags as mf 
Note: See TracChangeset for help on using the changeset viewer.