Changeset 17bbadd in sasmodels for sasmodels/kernelcl.py
- Timestamp:
- Mar 15, 2016 10:47:12 AM (8 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:
- 754e27b
- Parents:
- 5ceb7d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
re6a5556 r17bbadd 289 289 GPU wrapper for a single model. 290 290 291 *source* and * info* are the model source and interface as returned292 from :func:`gen .make`.291 *source* and *model_info* are the model source and interface as returned 292 from :func:`generate.make_source` and :func:`generate.make_model_info`. 293 293 294 294 *dtype* is the desired model precision. Any numpy dtype for single … … 300 300 that the compiler is allowed to take shortcuts. 301 301 """ 302 def __init__(self, source, info, dtype=generate.F32):303 self.info = info302 def __init__(self, source, model_info, dtype=generate.F32): 303 self.info = model_info 304 304 self.source = source 305 305 self.dtype = generate.F32 if dtype == 'fast' else np.dtype(dtype) … … 356 356 """ 357 357 def __init__(self, q_vectors, dtype=generate.F32): 358 # TODO: do we ever need double precision q? 358 359 env = environment() 359 360 self.nq = q_vectors[0].size … … 389 390 *kernel* is the GpuKernel object to call 390 391 391 * info* is the module information392 *model_info* is the module information 392 393 393 394 *q_vectors* is the q vectors at which the kernel should be evaluated … … 403 404 Call :meth:`release` when done with the kernel instance. 404 405 """ 405 def __init__(self, kernel, info, q_vectors, dtype):406 def __init__(self, kernel, model_info, q_vectors, dtype): 406 407 q_input = GpuInput(q_vectors, dtype) 407 408 self.kernel = kernel 408 self.info = info409 self.info = model_info 409 410 self.res = np.empty(q_input.nq, q_input.dtype) 410 411 dim = '2d' if q_input.is_2d else '1d' 411 self.fixed_pars = info['partype']['fixed-' + dim]412 self.pd_pars = info['partype']['pd-' + dim]412 self.fixed_pars = model_info['partype']['fixed-' + dim] 413 self.pd_pars = model_info['partype']['pd-' + dim] 413 414 414 415 # Inputs and outputs for each kernel call … … 430 431 else np.float32) # will never get here, so use np.float32 431 432 433 #print "pars", fixed_pars, pd_pars 432 434 res_bi = self.res_b 433 435 nq = np.uint32(self.q_input.nq)
Note: See TracChangeset
for help on using the changeset viewer.