Changeset 886fa25 in sasmodels
- Timestamp:
- Oct 6, 2016 2:24:32 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 5b37fd6
- Parents:
- 4a2e1e5
- git-author:
- Wojciech Potrzebowski <Wojciech.Potrzebowski@…> (10/06/16 14:24:32)
- git-committer:
- Andrew Jackson <andrew.jackson@…> (10/06/16 14:24:32)
- Files:
-
- 1 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/ref/gpu_computations.rst
r1875f4e r886fa25 1 1 .. _models-complitation: 2 2 3 **************** **4 Models Compliation 5 **************** **3 **************** 4 GPU Computations 5 **************** 6 6 SasView model evaluations can run on your graphics card (GPU) or they can run 7 7 on the processor (CPU). 8 8 9 9 To run on the GPU, your computer must have OpenCL drivers installed. 10 11 ... give details on how to identify graphics cards, how to tell if OpenCL 12 is already installed and where to get drivers if it is not ... 13 14 Note that Intel provides an OpenCL drivers for Intel processors. 15 This can sometimes make use of special vector instructions across multiple 16 processors, so it is worth installing if the GPU does not support double 17 precision. 18 You can install this driver alongside the GPU driver for NVIDIA or AMD. 10 For information about OpenCL installation see the 11 :ref:`opencl-installation` documentation 19 12 20 13 Where the model is evaluated is a little bit complicated. -
doc/ref/index.rst
r4a2e1e5 r886fa25 9 9 intro.rst 10 10 refs.rst 11 compilation.rst11 gpu_computations.rst 12 12 magnetism/magnetism.rst 13 13 sesans/sans_to_sesans.rst -
sasmodels/kerneldll.py
r3764ec1 r886fa25 73 73 import tempfile 74 74 import ctypes as ct # type: ignore 75 from ctypes import c_void_p, c_int32, c_longdouble, c_double, c_float # type: ignore 75 import _ctypes as _ct 76 76 import logging 77 77 … … 111 111 compiler = "unix" 112 112 113 ARCH = "" if ct.sizeof(c _void_p) > 4 else "x86" # 4 byte pointers on x86113 ARCH = "" if ct.sizeof(ct.c_void_p) > 4 else "x86" # 4 byte pointers on x86 114 114 if compiler == "unix": 115 115 # Generic unix compile … … 241 241 if not os.path.exists(dll): 242 242 need_recompile = True 243 elif getattr(sys, 'frozen', None) is not None:244 # TODO: don't suppress time stamp245 # Currently suppressing recompile when running in a frozen environment246 need_recompile = False247 243 else: 248 244 dll_time = os.path.getmtime(dll) … … 301 297 def _load_dll(self): 302 298 # type: () -> None 303 #print("dll", self.dllpath)304 299 try: 305 300 self._dll = ct.CDLL(self.dllpath) … … 308 303 raise 309 304 310 float_type = (c _float if self.dtype == generate.F32311 else c _double if self.dtype == generate.F64312 else c _longdouble)305 float_type = (ct.c_float if self.dtype == generate.F32 306 else ct.c_double if self.dtype == generate.F64 307 else ct.c_longdouble) 313 308 314 309 # int, int, int, int*, double*, double*, double*, double*, double 315 argtypes = [c _int32]*3 + [c_void_p]*4 + [float_type]310 argtypes = [ct.c_int32]*3 + [ct.c_void_p]*4 + [float_type] 316 311 names = [generate.kernel_name(self.info, variant) 317 312 for variant in ("Iq", "Iqxy", "Imagnetic")] … … 344 339 Release any resources associated with the model. 345 340 """ 341 dll_handle = self._dll._handle 346 342 if os.name == 'nt': 347 #dll = ct.cdll.LoadLibrary(self.dllpath)348 dll = ct.CDLL(self.dllpath)349 dll_handle = dll._handle350 #dll_handle = ct.c_void_p(dll._handle)351 del dll, self._dll352 self._dll = None353 343 ct.windll.kernel32.FreeLibrary(dll_handle) 354 344 else: 355 pass 356 345 _ct.dlclose(dll_handle) 346 del self._dll 347 self._dll = None 357 348 358 349 class DllKernel(Kernel): … … 411 402 #print("returned",self.q_input.q, self.result) 412 403 pd_norm = self.result[self.q_input.nq] 413 scale = values[0]/(pd_norm if pd_norm !=0.0 else 1.0)404 scale = values[0]/(pd_norm if pd_norm != 0.0 else 1.0) 414 405 background = values[1] 415 406 #print("scale",scale,background) -
sasmodels/sasview_model.py
r9c1a59c r886fa25 575 575 magnetic=is_magnetic) 576 576 calculator.release() 577 self._model.release() 577 578 return result 578 579
Note: See TracChangeset
for help on using the changeset viewer.