Changeset b8e5e21 in sasmodels for sasmodels/core.py
- Timestamp:
- Mar 16, 2016 8:22:29 AM (8 years ago)
- 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:
- 28da77d
- Parents:
- 667a6f2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/core.py
r17bbadd rb8e5e21 34 34 return available_models 35 35 36 def isstr(s): 37 """ 38 Return True if *s* is a string-like object. 39 """ 40 try: s + '' 41 except: return False 42 return True 43 44 def load_model(model_name, **kw): 45 """ 46 Load model info and build model. 47 """ 48 return build_model(load_model_info(model_name), **kw) 36 49 37 50 def load_model_info(model_name): … … 46 59 return generate.make_model_info(kernel_module) 47 60 48 49 def precompile_dll(model_name, dtype="double"):50 """51 Precompile the dll for a model.52 53 Returns the path to the compiled model, or None if the model is a pure54 python model.55 56 This can be used when build the windows distribution of sasmodels57 (which may be missing the OpenCL driver and the dll compiler), or58 otherwise sharing models with windows users who do not have a compiler.59 60 See :func:`sasmodels.kerneldll.make_dll` for details on controlling the61 dll path and the allowed floating point precision.62 """63 model_info = load_model_info(model_name)64 source = generate.make_source(model_info)65 return kerneldll.make_dll(source, model_info, dtype=dtype) if source else None66 67 68 def isstr(s):69 """70 Return True if *s* is a string-like object.71 """72 try: s + ''73 except: return False74 return True75 61 76 62 def build_model(model_info, dtype=None, platform="ocl"): … … 114 100 else: 115 101 return kernelcl.GpuModel(source, model_info, dtype) 102 103 def precompile_dll(model_name, dtype="double"): 104 """ 105 Precompile the dll for a model. 106 107 Returns the path to the compiled model, or None if the model is a pure 108 python model. 109 110 This can be used when build the windows distribution of sasmodels 111 (which may be missing the OpenCL driver and the dll compiler), or 112 otherwise sharing models with windows users who do not have a compiler. 113 114 See :func:`sasmodels.kerneldll.make_dll` for details on controlling the 115 dll path and the allowed floating point precision. 116 """ 117 model_info = load_model_info(model_name) 118 source = generate.make_source(model_info) 119 return kerneldll.make_dll(source, model_info, dtype=dtype) if source else None 120 116 121 117 122 def make_kernel(model, q_vectors):
Note: See TracChangeset
for help on using the changeset viewer.