LCOV - code coverage report
Current view: top level - synthesis/TransformMachines2 - accumulateFromGrid.inc (source / functions) Hit Total Coverage
Test: casa_coverage.info Lines: 30 30 100.0 %
Date: 2023-10-25 08:47:59 Functions: 0 0 -

          Line data    Source code
       1             : // -*- C++ -*-
       2             : //
       3             : // File to include to have the inner loops for de-gridding
       4             : // (prediction) without a function call.
       5             : //
       6             : //--------------------------------------------------------------------------------
       7             : {
       8      888546 :   Vector<Int> iCFPos(4,0);
       9             :   Int iLoc[2];
      10             :   Bool Dummy;
      11      888546 :   Complex wt;
      12             : 
      13      888546 :   const Int * __restrict__ gridInc_p_ptr = gridInc_p.getStorage(Dummy);
      14      888546 :   const Complex * __restrict__ gridStore = grid.getStorage(Dummy);
      15      888546 :   const Int* support_ptr    = support.getStorage(Dummy);
      16      888546 :   const Float *sampling_ptr = sampling.getStorage(Dummy);
      17      888546 :   const Double *off_ptr           = off.getStorage(Dummy);
      18      888546 :   const Int* convOrigin_ptr       = convOrigin.getStorage(Dummy);
      19      888546 :   const Int *loc_ptr = loc.getStorage(Dummy);
      20             : 
      21      888546 :   Int * __restrict__       igrdpos_ptr   = igrdpos.getStorage(Dummy);
      22      888546 :   Int *iCFPos_ptr                 = iCFPos.getStorage(Dummy);
      23      888546 :   Int *cfInc_p_ptr                = cfInc_p.getStorage(Dummy);
      24             :   Int phaseGradOrigin_l[2]; 
      25             :   
      26      888546 :   phaseGradOrigin_l[0] = cached_phaseGrad_p.shape()(0)/2 ;
      27      888546 :   phaseGradOrigin_l[1] = cached_phaseGrad_p.shape()(1)/2;
      28             :    
      29    13133616 :   for(Int iy=-support_ptr[1]; iy <= support_ptr[1]; iy++) 
      30             :     {
      31    12245070 :       iLoc[1]    = SynthesisUtils::nint(sampling_ptr[1]*iy+off_ptr[1]);
      32    12245070 :       igrdpos_ptr[1] = loc_ptr[1]+iy;
      33    12245070 :       iCFPos_ptr[1]  = iLoc[1] + convOrigin_ptr[1];
      34             : 
      35   188042448 :       for(Int ix=-support_ptr[0]; ix <= support_ptr[0]; ix++) 
      36             :         {
      37   175797378 :           iLoc[0]    = SynthesisUtils::nint(sampling_ptr[0]*ix+off_ptr[0]);
      38   175797378 :           igrdpos_ptr[0] = loc_ptr[0]+ix;
      39   175797378 :           iCFPos_ptr[0]  = iLoc[0] + convOrigin_ptr[0];
      40             :           {
      41             :             wt=getFrom4DArray((const Complex * __restrict__ &)convFuncV,
      42             :                               //igrdpos,cfInc_p);
      43   175797378 :                               iCFPos_ptr,cfInc_p_ptr);
      44   175797378 :             if (dataWVal <= 0.0) wt = conj(wt);
      45   175797378 :             norm(ipol)+=(wt);
      46   175797378 :             if (finitePointingOffset) 
      47             :               {
      48    73272078 :                 wt *= conj(cached_phaseGrad_p(iLoc[0]+phaseGradOrigin_l[0],
      49    73272078 :                                               iLoc[1]+phaseGradOrigin_l[1]));
      50             :               }
      51             :             // nvalue+=wt*grid(grdpos);
      52             :             // The following uses raw index on the 4D grid
      53             :             // nvalue+=wt*getFrom4DArray(gridStore,iPosPtr,gridInc);
      54   175797378 :             nvalue+=wt*getFrom4DArray(gridStore,igrdpos_ptr,gridInc_p_ptr);
      55             :             //nvalue+=wt*getFrom4DArray(gridStore,igrdpos,gridInc_p);
      56             :           }
      57             :         }
      58             :     }
      59      888546 :   nvalue = nvalue *conj(phasor);
      60             : }
      61             : //--------------------------------------------------------------------------------

Generated by: LCOV version 1.16