Changeset 2de9a5e in sasmodels for code_capcyl.py
- Timestamp:
- Jul 11, 2014 2:47:47 PM (10 years ago)
- 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:
- be5d7df
- Parents:
- 8faffcd
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code_capcyl.py
r8faffcd r2de9a5e 7 7 from weights import GaussianDispersion 8 8 from sasmodel import card 9 from Capcyl_Gauss import Gauss76Wt, Gauss76Z 9 10 10 11 def set_precision(src, qx, qy, dtype): … … 34 35 trala = open('NR_BessJ1.cpp').read()+"\n"+open('Capcyl_Kfun.cpp').read()+"\n"+open('Kernel-Cylinder.cpp').read() 35 36 src, qx, qy = set_precision(trala, qx, qy, dtype=dtype) 37 self.prg = cl.Program(ctx, src).build() 38 self.qx, self.qy = qx, qy 36 39 37 self.prg = cl.Program(ctx, open('Kernel-CapCyl.cpp').read()).build()38 40 39 41 #buffers … … 41 43 self.qx_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=self.qx) 42 44 self.qy_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=self.qy) 45 G, Z = Gauss76Wt, Gauss76Z 46 self.Gauss76W_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=G) 47 self.Gauss76Z_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=Z) 43 48 self.res_b = cl.Buffer(ctx, mf.WRITE_ONLY, qx.nbytes) 44 49 self.res = np.empty_like(self.qx) … … 73 78 np.float32(theta.value[k]), np.float32(phi.value[l]), np.float32(sub), np.float32(pars['scale']), 74 79 np.float32(phi.weight[l]), np.float32(theta.weight[k]), np.float32(rad_cap.weight[m]), 75 np.float32(rad_cyl.weight[i]), np.float32(length.weight[j]), np.uint32(self.qx.size), np.uint32(size)) 80 np.float32(rad_cyl.weight[i]), np.float32(length.weight[j]), np.uint32(self.qx.size), np.uint32(size), 81 self.Gauss76W_b, self.Gauss76Z_b) 76 82 77 83 cl.enqueue_copy(queue, self.res, self.res_b)
Note: See TracChangeset
for help on using the changeset viewer.