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.

: my_func(_func), my_begin(_begin), my_step(_step) {}
tbb::internal::parallel_for_body::my_step
const Index my_step
Definition: tbb/parallel_for.h:158
tbb::internal::parallel_for_body::my_begin
const Index my_begin
Definition: tbb/parallel_for.h:157
tbb::internal::parallel_for_body::my_func
const Function & my_func
Definition: tbb/parallel_for.h:156

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

{
// A set of local variables to help the compiler with vectorization of the following loop.
Index b = r.begin();
Index e = r.end();
Index ms = my_step;
Index k = my_begin + b*ms;
#if __INTEL_COMPILER
#pragma ivdep
#if __TBB_ASSERT_ON_VECTORIZATION_FAILURE
#pragma vector always assert
#endif
#endif
for ( Index i = b; i < e; ++i, k += ms ) {
my_func( k );
}
}
tbb::blocked_range::begin
const_iterator begin() const
Beginning of range.
Definition: blocked_range.h:69
tbb::blocked_range::end
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

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

Referenced by tbb::internal::parallel_for_body< Function, Index >::operator()().

## my_func

template<typename Function , typename Index >

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

private

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

Referenced by tbb::internal::parallel_for_body< Function, Index >::operator()().

## my_step

template<typename Function , typename Index >

const Index tbb::internal::parallel_for_body< Function, Index >::my_step

private

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

Referenced by tbb::internal::parallel_for_body< Function, Index >::operator()().

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

- tbb/parallel_for.h

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.