Changeset 2de9a5e in sasmodels for code_capcyl.py


Ignore:
Timestamp:
Jul 11, 2014 2:47:47 PM (10 years ago)
Author:
HMP1 <helen.park@…>
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
Message:

Update for Aaron

File:
1 moved

Legend:

Unmodified
Added
Removed
  • code_capcyl.py

    r8faffcd r2de9a5e  
    77from weights import GaussianDispersion 
    88from sasmodel import card 
     9from Capcyl_Gauss import Gauss76Wt, Gauss76Z 
    910 
    1011def set_precision(src, qx, qy, dtype): 
     
    3435        trala = open('NR_BessJ1.cpp').read()+"\n"+open('Capcyl_Kfun.cpp').read()+"\n"+open('Kernel-Cylinder.cpp').read() 
    3536        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 
    3639 
    37         self.prg = cl.Program(ctx, open('Kernel-CapCyl.cpp').read()).build() 
    3840 
    3941        #buffers 
     
    4143        self.qx_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=self.qx) 
    4244        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) 
    4348        self.res_b = cl.Buffer(ctx, mf.WRITE_ONLY, qx.nbytes) 
    4449        self.res = np.empty_like(self.qx) 
     
    7378                                        np.float32(theta.value[k]), np.float32(phi.value[l]), np.float32(sub), np.float32(pars['scale']), 
    7479                                        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) 
    7682 
    7783                            cl.enqueue_copy(queue, self.res, self.res_b) 
Note: See TracChangeset for help on using the changeset viewer.