Changeset 0d26e91 in sasmodels for sasmodels/kernelcl.py


Ignore:
Timestamp:
Mar 6, 2019 3:44:39 PM (5 years ago)
Author:
GitHub <noreply@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
15f5138
Parents:
da3638f (diff), e589e9a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Kienzle <pkienzle@…> (03/06/19 15:44:39)
git-committer:
GitHub <noreply@…> (03/06/19 15:44:39)
Message:

Merge branch 'beta_approx' into ticket-1015-gpu-mem-error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r3199b17 r0d26e91  
    5858import time 
    5959 
     60try: 
     61    from time import perf_counter as clock 
     62except ImportError: # CRUFT: python < 3.3 
     63    import sys 
     64    if sys.platform.count("darwin") > 0: 
     65        from time import time as clock 
     66    else: 
     67        from time import clock 
     68 
    6069import numpy as np  # type: ignore 
    61  
    6270 
    6371# Attempt to setup OpenCL. This may fail if the pyopencl package is not 
     
    592600        #call_details.show(values) 
    593601        wait_for = None 
    594         last_nap = time.clock() 
     602        last_nap = clock() 
    595603        step = 1000000//self.q_input.nq + 1 
    596604        for start in range(0, call_details.num_eval, step): 
     
    603611                # Allow other processes to run. 
    604612                wait_for[0].wait() 
    605                 current_time = time.clock() 
     613                current_time = clock() 
    606614                if current_time - last_nap > 0.5: 
    607615                    time.sleep(0.001) 
Note: See TracChangeset for help on using the changeset viewer.