Changeset a42fec0 in sasmodels for Models/code_lamellar.py


Ignore:
Timestamp:
Aug 4, 2014 5:20:07 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:
8cdb9f1
Parents:
099e053
Message:

Speed-up of 3X, compare.py working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Models/code_lamellar.py

    rca6c007 ra42fec0  
    55import pyopencl as cl 
    66from Models.weights import GaussianDispersion 
    7  
    8 def set_precision(src, qx, qy, dtype): 
    9     qx = np.ascontiguousarray(qx, dtype=dtype) 
    10     qy = np.ascontiguousarray(qy, dtype=dtype) 
    11     if dtype == 'double': 
    12         header = """\ 
    13 #define real float 
    14 """ 
    15     else: 
    16         header = """\ 
    17 #pragma OPENCL EXTENSION cl_khr_fp64: enable 
    18 #define real double 
    19 """ 
    20     return header+src, qx, qy 
     7from sasmodel import set_precision 
    218 
    229 
Note: See TracChangeset for help on using the changeset viewer.