[vspline] 36/72: minor changes

Kay F. Jahnke kfj-guest at moszumanska.debian.org
Sun Jul 2 09:02:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

kfj-guest pushed a commit to branch master
in repository vspline.

commit a5036912d59441db3751d379beb4719a1d98e50e
Author: Kay F. Jahnke <kfjahnke at gmail.com>
Date:   Fri Feb 24 10:32:44 2017 +0100

    minor changes
---
 bspline.h     |  2 +-
 filter.h      |  3 +++
 multithread.h |  2 +-
 remap.h       | 22 ++++++++++++++++------
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/bspline.h b/bspline.h
index 02baed9..4e893ac 100644
--- a/bspline.h
+++ b/bspline.h
@@ -504,7 +504,7 @@ public:
         // would by filling the brace after the coefficients have been calculated.
         // The difference will be larger towards the margin of the frame, and we assume
         // that due to the small support of the evaluation the differences near the
-        // margin of the core data will be negligibla, having picked a sufficiently
+        // margin of the core data will be negligible, having picked a sufficiently
         // large frame size. This is debatable.
         for ( int d = 0 ; d < dimension ; d++ )
           br.apply ( container , bcv[d] , left_frame[d] , right_frame[d] , d ) ;
diff --git a/filter.h b/filter.h
index baf74d6..2b64fc6 100644
--- a/filter.h
+++ b/filter.h
@@ -780,7 +780,10 @@ filter ( int _M ,               ///< number of input/output elements (DataLength
     _p_iacc = & filter_type::iacc_guess ;
   }
   else
+  {
+    std::cout << "boundary condition " << bc << " not supported by vspline::filter" << std::endl ;
     throw not_supported ( "boundary condition not supported by vspline::filter" ) ;
+  }
 }
 
 } ; // end of class filter
diff --git a/multithread.h b/multithread.h
index 4bc1915..4e213d0 100644
--- a/multithread.h
+++ b/multithread.h
@@ -274,7 +274,7 @@ struct shape_splitter
 
 // template < int d >
 // partition_type < shape_range_type<d> >
-// _partition ( shape_range_type<d> range , int nparts )
+// partition ( shape_range_type<d> range , int nparts )
 // {
 //   if ( range[0].any() )
 //   {
diff --git a/remap.h b/remap.h
index fdefecd..f72761b 100644
--- a/remap.h
+++ b/remap.h
@@ -436,10 +436,10 @@ struct _fill < generator_type , 1 >
       int aggregates = leftover / vsize ;        // number of full vectors
       leftover -= aggregates * vsize ;           // remaining leftover single values
       value_type * destination = output.data() ; // pointer to target's memory
+      value_type target_buffer [ vsize ] ;
 
       if ( output.isUnstrided() )
       {
-//         std::cout << "case fill1:1" << std::endl ;
         // best case: output array has consecutive memory
         for ( int a = 0 ; a < aggregates ; a++ , destination += vsize )
         {
@@ -447,15 +447,12 @@ struct _fill < generator_type , 1 >
         }
         target_it += aggregates * vsize ; // advance target_it to remaining single values
       }
-
       else
       {
-//         std::cout << "case fill1:2" << std::endl ;
         // fall back to buffering and storing individual result values. coming from
         // nD via hierarchical descent will never land here, because the case that
         // dimension 0 is strided is dealt with straight away, but the 1D strided
         // case needs this bit:
-        value_type target_buffer [ vsize ] ;
         for ( int a = 0 ; a < aggregates ; a++ )
         {
           gen ( target_buffer ) ;        // pass pointer to buffer to generator
@@ -466,14 +463,27 @@ struct _fill < generator_type , 1 >
           }
         }
       }
+      // deal with leftovers by generating a full simdized datum, then copy
+      // only leftover values to target. Comment out this bit to fall back to
+      // single-value processing of leftovers. Potentially unsafe, may read-access
+      // out-of-bounds memory (not write-access, though). Currently unused.
+//       if ( leftover )
+//       {
+//         gen ( target_buffer ) ;
+//         for ( int e = 0 ; e < leftover ; e++ )
+//         {
+//           *target_it = target_buffer[e] ;   // and deposit in target
+//           ++target_it ;
+//         } 
+//         leftover = 0 ;
+//       }
     }
     
-  #endif // USE_VC
+#endif // USE_VC
 
     // process leftovers, if any - if vc isn't used, this loop does all the processing
     while ( leftover-- )
     {
-      std::cout << "fill1:leftovers" << std::endl ;
       // process leftovers with single-value evaluation
       gen ( *target_it ) ;
       ++target_it ;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vspline.git



More information about the debian-science-commits mailing list