Changes in / [3bcb88c:1392831] in sasmodels
- Location:
- sasmodels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
r7722b4a r0dc34c3 316 316 317 317 318 def timestamp(model_info):318 def dll_timestamp(model_info): 319 319 # type: (ModelInfo) -> int 320 320 """ 321 321 Return a timestamp for the model corresponding to the most recently 322 322 changed file or dependency. 323 """ 324 # TODO: fails DRY; templates appear two places. 325 model_templates = [joinpath(DATA_PATH, filename) 326 for filename in ('kernel_header.c', 'kernel_iq.c')] 327 source_files = (model_sources(model_info) 328 + model_templates 329 + [model_info.filename]) 330 # Note: file may not exist when it is a standard model from library.zip 331 times = [getmtime(f) for f in source_files if exists(f)] 332 newest = max(times) if times else 0 333 return newest 334 335 def ocl_timestamp(model_info): 336 # type: (ModelInfo) -> int 337 """ 338 Return a timestamp for the model corresponding to the most recently 339 changed file or dependency. 323 340 324 341 Note that this does not look at the time stamps for the OpenCL header 325 342 information since that need not trigger a recompile of the DLL. 326 343 """ 344 # TODO: fails DRY; templates appear two places. 345 model_templates = [joinpath(DATA_PATH, filename) 346 for filename in ('kernel_header.c', 'kernel_iq.cl')] 327 347 source_files = (model_sources(model_info) 328 + model_templates ()348 + model_templates 329 349 + [model_info.filename]) 330 newest = max(getmtime(f) for f in source_files) 350 # Note: file may not exist when it is a standard model from library.zip 351 times = [getmtime(f) for f in source_files if exists(f)] 352 newest = max(times) if times else 0 331 353 return newest 332 333 334 def model_templates():335 # type: () -> List[str]336 # TODO: fails DRY; templates appear two places.337 # should instead have model_info contain a list of paths338 # Note: kernel_iq.cl is not on this list because changing it need not339 # trigger a recompile of the dll.340 return [joinpath(DATA_PATH, filename)341 for filename in ('kernel_header.c', 'kernel_iq.c')]342 354 343 355 -
sasmodels/kernelcl.py
r300a2f7 r0dc34c3 397 397 if self.program is None: 398 398 compile_program = environment().compile_program 399 timestamp = generate. timestamp(self.info)399 timestamp = generate.ocl_timestamp(self.info) 400 400 self.program = compile_program( 401 401 self.info.name, -
sasmodels/kerneldll.py
rbde38b5 r0dc34c3 226 226 else: 227 227 dll_time = os.path.getmtime(dll) 228 newest_source = generate. timestamp(model_info)228 newest_source = generate.dll_timestamp(model_info) 229 229 need_recompile = dll_time < newest_source 230 230 if need_recompile:
Note: See TracChangeset
for help on using the changeset viewer.