Changeset 2de9a5e in sasmodels for code_lamellar.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_lamellar.py
r8a20be5 r2de9a5e 11 11 if dtype == 'double': 12 12 header = """\ 13 #define real float 14 """ 15 else: 16 header = """\ 13 17 #pragma OPENCL EXTENSION cl_khr_fp64: enable 14 18 #define real double 15 19 """ 16 return header+src,qx,qy 17 else: 18 return src,qx,qy 20 return header+src, qx, qy 19 21 20 22 … … 23 25 'scale':1, 'bi_thick':1, 'sld_bi':1e-6, 'sld_sol':0, 'background':0, 24 26 } 25 26 def __init__(self, qx, qy, dtype='float '):27 PD_PARS = {'bi_thick'} 28 def __init__(self, qx, qy, dtype='float32'): 27 29 28 30 #create context, queue, and build program … … 51 53 for i in xrange(len(bi_thick.weight)): 52 54 self.prg.LamellarKernel(self.queue, self.qx.shape, None, self.qx_b, self.qy_b, self.res_b, real(bi_thick.value[i]), 53 real(pars['scale']), real(sub), real(pars['background']),np.uint32(self.qx.size))55 real(pars['scale']), real(sub), np.uint32(self.qx.size)) 54 56 cl.enqueue_copy(self.queue, self.res, self.res_b) 55 57
Note: See TracChangeset
for help on using the changeset viewer.