Changeset 6f89000 in sasmodels
- Timestamp:
- Sep 24, 2016 5:51:20 PM (8 years ago)
- Children:
- d3e3c46a
- Parents:
- 52ec91e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
ra557a99 r6f89000 54 54 import warnings 55 55 import logging 56 import time 56 57 57 58 import numpy as np # type: ignore … … 557 558 #call_details.show(values) 558 559 # Call kernel and retrieve results 559 last_call = None 560 step = 100 560 wait_for = None 561 last_nap = time.clock() 562 step = 1000000//self.q_input.nq + 1 561 563 for start in range(0, call_details.num_eval, step): 562 564 stop = min(start + step, call_details.num_eval) 563 565 #print("queuing",start,stop) 564 566 args[1:3] = [np.int32(start), np.int32(stop)] 565 last_call = [kernel(self.queue, self.q_input.global_size, 566 None, *args, wait_for=last_call)] 567 wait_for = [kernel(self.queue, self.q_input.global_size, None, 568 *args, wait_for=wait_for)] 569 if stop < call_details.num_eval: 570 # Allow other processes to run 571 wait_for[0].wait() 572 current_time = time.clock() 573 if current_time - last_nap > 0.5: 574 time.sleep(0.05) 575 last_nap = current_time 567 576 cl.enqueue_copy(self.queue, self.result, self.result_b) 568 577 #print("result", self.result)
Note: See TracChangeset
for help on using the changeset viewer.