Changeset bde38b5 in sasmodels for sasmodels/kernel_iq.cl


Ignore:
Timestamp:
Aug 14, 2016 9:12:40 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
ac98886
Parents:
b1c40bee
git-author:
Paul Kienzle <pkienzle@…> (08/14/16 21:08:59)
git-committer:
Paul Kienzle <pkienzle@…> (08/14/16 21:12:40)
Message:

simplify kernel calling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_iq.cl

    r4f1f876 rbde38b5  
    2222    int32_t pd_stride[MAX_PD];  // stride to move to the next index at this level 
    2323#endif // MAX_PD > 0 
    24     int32_t pd_prod;            // total number of voxels in hypercube 
    25     int32_t pd_sum;             // total length of the weights vector 
     24    int32_t num_eval;           // total number of voxels in hypercube 
     25    int32_t num_weights;        // total length of the weights vector 
    2626    int32_t num_active;         // number of non-trivial pd loops 
    2727    int32_t theta_par;          // id of spherical correction variable 
     
    9090 
    9191  // Storage for the current parameter values.  These will be updated as we 
    92   // walk the polydispersity cube.  local_values will be aliased to pvec. 
     92  // walk the polydispersity cube. 
    9393  ParameterBlock local_values; 
    94  
    95   // Fill in the initial variables 
    96   for (int i=0; i < NUM_PARS; i++) { 
    97     local_values.vector[i] = values[2+i]; 
    98 //if (q_index==0) printf("p%d = %g\n",i, local_values.vector[i]); 
    99   } 
    10094 
    10195#if defined(MAGNETIC) && NUM_MAGNETIC>0 
     
    117111#endif // MAGNETIC 
    118112 
    119   double pd_norm, this_result; 
    120   if (pd_start == 0) { 
    121     pd_norm = this_result = 0.0; 
    122   } else { 
    123     pd_norm = result[nq]; 
    124     this_result = result[q_index]; 
    125   } 
     113  // Fill in the initial variables 
     114  //   values[0] is scale 
     115  //   values[1] is background 
     116  for (int i=0; i < NUM_PARS; i++) { 
     117    local_values.vector[i] = values[2+i]; 
     118//if (q_index==0) printf("p%d = %g\n",i, local_values.vector[i]); 
     119  } 
     120//if (q_index==0) printf("NUM_VALUES:%d  NUM_PARS:%d  MAX_PD:%d\n", NUM_VALUES, NUM_PARS, MAX_PD); 
     121//if (q_index==0) printf("start:%d stop:%d\n", pd_start, pd_stop); 
     122 
     123  double pd_norm = (pd_start == 0 ? 0.0 : result[nq]); 
     124  double this_result = (pd_start == 0 ? 0.0 : result[q_index]); 
    126125//if (q_index==0) printf("start %d %g %g\n", pd_start, pd_norm, this_result); 
    127126 
    128127#if MAX_PD>0 
    129   global const double *pd_value = values + NUM_VALUES + 2; 
    130   global const double *pd_weight = pd_value + details->pd_sum; 
     128  global const double *pd_value = values + NUM_VALUES; 
     129  global const double *pd_weight = pd_value + details->num_weights; 
    131130#endif 
    132131 
     
    256255        // TODO: what is the magnetic scattering at q=0 
    257256        if (qsq > 1.e-16) { 
    258           double p[4];  // spin_i, spin_f 
     257          double p[4];  // dd, du, ud, uu 
    259258          p[0] = (qy*cos_mspin + qx*sin_mspin)/qsq; 
    260259          p[3] = -p[0]; 
Note: See TracChangeset for help on using the changeset viewer.