Changeset 5399809 in sasmodels for sasmodels/kernelcl.py
- Timestamp:
- Aug 21, 2018 1:32:40 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 2a12351b
- Parents:
- c57ee9e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
r6e7ba14 r5399809 481 481 # at this point, so instead using 32, which is good on the set of 482 482 # architectures tested so far. 483 extra_q = 3 # total weight, weighted volume and weighted radius 483 484 if self.is_2d: 484 # Note: 16 rather than 15 because result is 1 longer than input. 485 width = ((self.nq+16)//16)*16 485 width = ((self.nq+15+extra_q)//16)*16 486 486 self.q = np.empty((width, 2), dtype=dtype) 487 487 self.q[:self.nq, 0] = q_vectors[0] 488 488 self.q[:self.nq, 1] = q_vectors[1] 489 489 else: 490 # Note: 32 rather than 31 because result is 1 longer than input. 491 width = ((self.nq+32)//32)*32 490 width = ((self.nq+31+extra_q)//32)*32 492 491 self.q = np.empty(width, dtype=dtype) 493 492 self.q[:self.nq] = q_vectors[0] … … 539 538 self.dim = '2d' if q_input.is_2d else '1d' 540 539 # leave room for f1/f2 results in case we need to compute beta for 1d models 541 n um_returns = 1 if self.dim == '2d' else 2 #542 # plus 1 for the normalization value, plus another for R_eff543 self.result = np.empty( (q_input.nq+2)*num_returns,dtype)540 nout = 2 if self.info.have_Fq and self.dim == '1d' else 1 541 # plus 3 weight, volume, radius 542 self.result = np.empty(q_input.nq*nout + 3, self.dtype) 544 543 545 544 # Inputs and outputs for each kernel call … … 549 548 550 549 self.result_b = cl.Buffer(self.queue.context, mf.READ_WRITE, 551 q_input.global_size[0] * n um_returns* dtype.itemsize)550 q_input.global_size[0] * nout * dtype.itemsize) 552 551 self.q_input = q_input # allocated by GpuInput above 553 552
Note: See TracChangeset
for help on using the changeset viewer.