Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::parallel_for_body< Function, Index > Class Template Reference

Calls the function with values from range [begin, end) with a step provided. More...

#include <parallel_for.h>

Inheritance diagram for tbb::internal::parallel_for_body< Function, Index >:
Collaboration diagram for tbb::internal::parallel_for_body< Function, Index >:

Public Member Functions

 parallel_for_body (const Function &_func, Index &_begin, Index &_step)
 
void operator() (const tbb::blocked_range< Index > &r) const
 

Private Attributes

const Function & my_func
 
const Index my_begin
 
const Index my_step
 

Detailed Description

template<typename Function, typename Index>
class tbb::internal::parallel_for_body< Function, Index >

Calls the function with values from range [begin, end) with a step provided.

Definition at line 152 of file tbb/parallel_for.h.

Constructor & Destructor Documentation

◆ parallel_for_body()

template<typename Function , typename Index >
tbb::internal::parallel_for_body< Function, Index >::parallel_for_body ( const Function &  _func,
Index &  _begin,
Index &  _step 
)
inline

Definition at line 157 of file tbb/parallel_for.h.

Member Function Documentation

◆ operator()()

template<typename Function , typename Index >
void tbb::internal::parallel_for_body< Function, Index >::operator() ( const tbb::blocked_range< Index > &  r) const
inline

Definition at line 160 of file tbb/parallel_for.h.

References tbb::blocked_range< Value >::begin(), and tbb::blocked_range< Value >::end().

160  {
161  // A set of local variables to help the compiler with vectorization of the following loop.
162  Index b = r.begin();
163  Index e = r.end();
164  Index ms = my_step;
165  Index k = my_begin + b*ms;
166 
167 #if __INTEL_COMPILER
168 #pragma ivdep
169 #if __TBB_ASSERT_ON_VECTORIZATION_FAILURE
170 #pragma vector always assert
171 #endif
172 #endif
173  for ( Index i = b; i < e; ++i, k += ms ) {
174  my_func( k );
175  }
176  }
const_iterator begin() const
Beginning of range.
Definition: blocked_range.h:69
const_iterator end() const
One past last value in range.
Definition: blocked_range.h:72
Here is the call graph for this function:

Member Data Documentation

◆ my_begin

template<typename Function , typename Index >
const Index tbb::internal::parallel_for_body< Function, Index >::my_begin
private

Definition at line 154 of file tbb/parallel_for.h.

◆ my_func

template<typename Function , typename Index >
const Function& tbb::internal::parallel_for_body< Function, Index >::my_func
private

Definition at line 153 of file tbb/parallel_for.h.

◆ my_step

template<typename Function , typename Index >
const Index tbb::internal::parallel_for_body< Function, Index >::my_step
private

Definition at line 155 of file tbb/parallel_for.h.


The documentation for this class was generated from the following file:

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.