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 156 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 161 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 164 of file tbb/parallel_for.h.

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

References tbb::blocked_range< Value >::begin(), tbb::blocked_range< Value >::end(), tbb::internal::parallel_for_body< Function, Index >::my_begin, tbb::internal::parallel_for_body< Function, Index >::my_func, and tbb::internal::parallel_for_body< Function, Index >::my_step.

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

◆ my_func

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

◆ my_step

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

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.