Changeset a738209 in sasmodels for sasmodels/kernelcl.py


Ignore:
Timestamp:
Jul 15, 2016 7:33:33 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
def2c1b
Parents:
98ba1fc
Message:

simplify kernels by remove coordination parameter logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r56b2687 ra738209  
    521521                     else np.float32)  # will never get here, so use np.float32 
    522522 
    523     def __call__(self, call_details, weights, values, cutoff): 
     523    def __call__(self, call_details, values, cutoff): 
    524524        # type: (CallDetails, np.ndarray, np.ndarray, float) -> np.ndarray 
    525525        context = self.queue.context 
     
    527527        details_b = cl.Buffer(context, mf.READ_ONLY | mf.COPY_HOST_PTR, 
    528528                              hostbuf=call_details.buffer) 
    529         weights_b = cl.Buffer(context, mf.READ_ONLY | mf.COPY_HOST_PTR, 
    530                               hostbuf=weights) if len(weights) else None 
    531529        values_b = cl.Buffer(context, mf.READ_ONLY | mf.COPY_HOST_PTR, 
    532530                             hostbuf=values) 
     
    534532        # Call kernel and retrieve results 
    535533        step = 100 
    536         for start in range(0, call_details.total_pd, step): 
    537             stop = min(start+step, call_details.total_pd) 
     534        for start in range(0, call_details.pd_prod, step): 
     535            stop = min(start+step, call_details.pd_prod) 
    538536            args = [ 
    539537                np.uint32(self.q_input.nq), np.int32(start), np.int32(stop), 
    540                 details_b, weights_b, values_b, self.q_input.q_b, self.result_b, 
     538                details_b, values_b, self.q_input.q_b, self.result_b, 
    541539                self.real(cutoff), 
    542540            ] 
     
    545543 
    546544        # Free buffers 
    547         for v in (details_b, weights_b, values_b): 
     545        for v in (details_b, values_b): 
    548546            if v is not None: v.release() 
    549547 
Note: See TracChangeset for help on using the changeset viewer.