Changeset 88b92e1 in sasmodels


Ignore:
Timestamp:
May 20, 2016 11:26:03 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
33af590
Parents:
aa9e4e3
Message:

monkey patch pyopencl so that include path is quoted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r821a9c6 r88b92e1  
    6161    warnings.warn(str(exc)) 
    6262    raise RuntimeError("OpenCL not available") 
     63 
     64# CRUFT: pyopencl as of June 2016 needs quotes around include path 
     65def _quote_path(v): 
     66    return '"'+v+'"' if ' ' in v and not v.startswith('-') else v 
     67 
     68if hasattr(cl, '_DEFAULT_INCLUDE_OPTIONS'): 
     69    cl._DEFAULT_INCLUDE_OPTIONS = [_quote_path(v) for v in cl._DEFAULT_INCLUDE_OPTIONS] 
    6370 
    6471from pyopencl import mem_flags as mf 
     
    224231            context = self.get_context(dtype) 
    225232            logging.info("building %s for OpenCL %s" 
    226                          % (key, context.devices[0].name)) 
     233                         % (key, context.devices[0].name.strip())) 
    227234            program = compile_model(context, source, np.dtype(dtype), fast) 
    228235            self.compiled[key] = program 
Note: See TracChangeset for help on using the changeset viewer.