Changes in / [aea2e2a:3a8d205] in sasmodels
- Files:
-
- 2 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/ref/index.rst
r1875f4e r0c1e5a9 9 9 intro.rst 10 10 refs.rst 11 compilation.rst11 gpu_computations.rst 12 12 magnetism/magnetism.rst -
sasmodels/kerneldll.py
r3764ec1 r8b10fdf 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 r9acbd37 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.