]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
added TBB's parallel_reduce support
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Thu, 25 Mar 2010 23:00:58 +0000 (23:00 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Thu, 25 Mar 2010 23:00:58 +0000 (23:00 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2910 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/include/opencv/cvinternal.h

index 7e01c15fba7d0b3aa2eb48905708ef8823301e0b..342df260168042e0c763a783cf7d543a38f4926f 100644 (file)
@@ -143,18 +143,26 @@ CV_INLINE IppiSize ippiSize(int width, int height)
     {
         typedef tbb::blocked_range<int> BlockedRange;
         
-        template<typename Body>
+        template<typename Body> static inline
         void parallel_for( const BlockedRange& range, const Body& body )
         {
             tbb::parallel_for(range, body);
         }
         
-        template<typename Iterator, typename Body>
+        template<typename Iterator, typename Body> static inline
         void parallel_do( Iterator first, Iterator last, const Body& body )
         {
             tbb::parallel_do(first, last, body);
         }
         
+        typedef tbb::split split;
+        
+        template<typename Body> static inline
+        void parallel_reduce( const BlockedRange& range, const Body& body )
+        {
+            tbb::parallel_reduce(range, body);
+        }
+        
         typedef tbb::concurrent_vector<Rect> ConcurrentRectVector;
     }
 #else
@@ -173,19 +181,27 @@ CV_INLINE IppiSize ippiSize(int width, int height)
             int _begin, _end, _grainsize;
         };
 
-        template<typename Body>
+        template<typename Body> static inline
         void parallel_for( const BlockedRange& range, const Body& body )
         {
             body(range);
         }
         
-        template<typename Iterator, typename Body>
+        template<typename Iterator, typename Body> static inline
         void parallel_do( Iterator first, Iterator last, const Body& body )
         {
             for( ; first != last; ++first )
                 body(*first);
         }
         
+        class split {};
+        
+        template<typename Body> static inline
+        void parallel_reduce( const BlockedRange& range, const Body& body )
+        {
+            body(range);
+        }
+        
         typedef std::vector<Rect> ConcurrentRectVector;
     }
 #endif