Home ⌂Doc Index ◂Up ▴
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
 

Additional Inherited Members

- Private Member Functions inherited from tbb::internal::no_assign
void operator= (const no_assign &)=delete
 
 no_assign (const no_assign &)=default
 
 no_assign ()=default
 

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 155 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 160 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 163 of file tbb/parallel_for.h.

163  {
164  // A set of local variables to help the compiler with vectorization of the following loop.
165  Index b = r.begin();
166  Index e = r.end();
167  Index ms = my_step;
168  Index k = my_begin + b*ms;
169 
170 #if __INTEL_COMPILER
171 #pragma ivdep
172 #if __TBB_ASSERT_ON_VECTORIZATION_FAILURE
173 #pragma vector always assert
174 #endif
175 #endif
176  for ( Index i = b; i < e; ++i, k += ms ) {
177  my_func( k );
178  }
179  }
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

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-2020 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.