Changeset b093c1c in sasmodels for sasmodels/kernelcl.py


Ignore:
Timestamp:
Oct 30, 2018 8:53:04 AM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
8064d5e
Parents:
f31815d (diff), c6084f1 (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.
Message:

Merge branch 'master' into py3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    rd86f0fc rf31815d  
    5656import time 
    5757 
     58try: 
     59    from time import perf_counter as clock 
     60except ImportError: # CRUFT: python < 3.3 
     61    import sys 
     62    if sys.platform.count("darwin") > 0: 
     63        from time import time as clock 
     64    else: 
     65        from time import clock 
     66 
    5867import numpy as np  # type: ignore 
    59  
    6068 
    6169# Attempt to setup opencl. This may fail if the opencl package is not 
     
    575583        # Call kernel and retrieve results 
    576584        wait_for = None 
    577         last_nap = time.clock() 
     585        last_nap = clock() 
    578586        step = 1000000//self.q_input.nq + 1 
    579587        for start in range(0, call_details.num_eval, step): 
     
    586594                # Allow other processes to run 
    587595                wait_for[0].wait() 
    588                 current_time = time.clock() 
     596                current_time = clock() 
    589597                if current_time - last_nap > 0.5: 
    590598                    time.sleep(0.05) 
Note: See TracChangeset for help on using the changeset viewer.