Changeset 8b10fdf in sasmodels
- Timestamp:
- Oct 6, 2016 10:43:28 AM (8 years ago)
- Children:
- 3a8d205
- Parents:
- 9acbd37
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kerneldll.py
r9acbd37 r8b10fdf 74 74 import ctypes as ct # type: ignore 75 75 import _ctypes as _ct 76 from ctypes import c_void_p, c_int32, c_longdouble, c_double, c_float # type: ignore77 76 import logging 78 77 … … 112 111 compiler = "unix" 113 112 114 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 115 114 if compiler == "unix": 116 115 # Generic unix compile … … 242 241 if not os.path.exists(dll): 243 242 need_recompile = True 244 #elif getattr(sys, 'frozen', None) is not None:245 # # TODO: don't suppress time stamp246 # # Currently suppressing recompile when running in a frozen environment247 # need_recompile = False248 243 else: 249 244 dll_time = os.path.getmtime(dll) … … 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")] … … 407 402 #print("returned",self.q_input.q, self.result) 408 403 pd_norm = self.result[self.q_input.nq] 409 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) 410 405 background = values[1] 411 406 #print("scale",scale,background)
Note: See TracChangeset
for help on using the changeset viewer.