Changeset 74e9b5f in sasmodels for sasmodels/kernel_iq.c


Ignore:
Timestamp:
Oct 12, 2018 10:52:48 PM (6 years ago)
Author:
pkienzle
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
4de14584
Parents:
b0de252
Message:

autotag functions as device functions for cuda. Refs #1076.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_iq.c

    rb0de252 r74e9b5f  
    6767 
    6868// Return value restricted between low and high 
    69 __device__ 
    7069static double clip(double value, double low, double high) 
    7170{ 
     
    8079//     du * (m_sigma_y + 1j*m_sigma_z); 
    8180// weights for spin crosssections: dd du real, ud real, uu, du imag, ud imag 
    82 __device__ 
    8381static void set_spin_weights(double in_spin, double out_spin, double weight[6]) 
    8482{ 
     
    105103 
    106104// Compute the magnetic sld 
    107 __device__ 
    108105static double mag_sld( 
    109106  const unsigned int xs, // 0=dd, 1=du.real, 2=ud.real, 3=uu, 4=du.imag, 5=ud.imag 
     
    154151// jitter angles (dtheta, dphi).  This matrix can be applied to all of the 
    155152// (qx, qy) points in the image to produce R*[qx,qy]' = [qa,qc]' 
    156 __device__ 
    157153static void 
    158154qac_rotation( 
     
    188184// Apply the rotation matrix returned from qac_rotation to the point (qx,qy), 
    189185// returning R*[qx,qy]' = [qa,qc]' 
    190 __device__ 
    191186static void 
    192187qac_apply( 
     
    216211// jitter angles (dtheta, dphi, dpsi).  This matrix can be applied to all of the 
    217212// (qx, qy) points in the image to produce R*[qx,qy]' = [qa,qb,qc]' 
    218 __device__ 
    219213static void 
    220214qabc_rotation( 
     
    263257// Apply the rotation matrix returned from qabc_rotation to the point (qx,qy), 
    264258// returning R*[qx,qy]' = [qa,qb,qc]' 
    265 __device__ 
    266259static void 
    267260qabc_apply( 
     
    285278    const int32_t pd_start,     // where we are in the dispersity loop 
    286279    const int32_t pd_stop,      // where we are stopping in the dispersity loop 
    287     global_par const ProblemDetails *details, 
    288     global_par const double *values, 
    289     global_par const double *q, // nq q values, with padding to boundary 
    290     global_par double *result,  // nq+1 return values, again with padding 
     280    pglobal const ProblemDetails *details, 
     281    pglobal const double *values, 
     282    pglobal const double *q, // nq q values, with padding to boundary 
     283    pglobal double *result,  // nq+1 return values, again with padding 
    291284    const double cutoff     // cutoff in the dispersity weight product 
    292285    ) 
     
    386379  const int n4 = pd_length[4]; 
    387380  const int p4 = pd_par[4]; 
    388   global_var const double *v4 = pd_value + pd_offset[4]; 
    389   global_var const double *w4 = pd_weight + pd_offset[4]; 
     381  pglobal const double *v4 = pd_value + pd_offset[4]; 
     382  pglobal const double *w4 = pd_weight + pd_offset[4]; 
    390383  int i4 = (pd_start/pd_stride[4])%n4;  // position in level 4 at pd_start 
    391384 
     
    573566  const int n##_LOOP = details->pd_length[_LOOP]; \ 
    574567  const int p##_LOOP = details->pd_par[_LOOP]; \ 
    575   global_var const double *v##_LOOP = pd_value + details->pd_offset[_LOOP]; \ 
    576   global_var const double *w##_LOOP = pd_weight + details->pd_offset[_LOOP]; \ 
     568  pglobal const double *v##_LOOP = pd_value + details->pd_offset[_LOOP]; \ 
     569  pglobal const double *w##_LOOP = pd_weight + details->pd_offset[_LOOP]; \ 
    577570  int i##_LOOP = (pd_start/details->pd_stride[_LOOP])%n##_LOOP; 
    578571 
     
    598591// Pointers to the start of the dispersity and weight vectors, if needed. 
    599592#if MAX_PD>0 
    600   global_var const double *pd_value = values + NUM_VALUES; 
    601   global_var const double *pd_weight = pd_value + details->num_weights; 
     593  pglobal const double *pd_value = values + NUM_VALUES; 
     594  pglobal const double *pd_weight = pd_value + details->num_weights; 
    602595#endif 
    603596 
Note: See TracChangeset for help on using the changeset viewer.