tbb::internal::affinity_partitioner_base_v3 Class Reference

Defines entry point for affinity partitioner into tbb run-time library. More...

`#include <partitioner.h>`

Inheritance diagram for tbb::internal::affinity_partitioner_base_v3:
Collaboration diagram for tbb::internal::affinity_partitioner_base_v3:

## Private Member Functions

| affinity_partitioner_base_v3 ()
| Zeros the fields. More...
| ~affinity_partitioner_base_v3 ()
| Deallocates my_array. More...
void __TBB_EXPORTED_METHOD | resize (unsigned factor)
| Resize my_array. More...
Private Member Functions inherited from tbb::internal::no_copy
| no_copy (const no_copy &)=delete
| no_copy ()=default

## Private Attributes

affinity_id * | my_array
| Array that remembers affinities of tree positions to affinity_id. More...
size_t | my_size
| Number of elements in my_array. More...

## Friends

class | tbb::affinity_partitioner
class | tbb::interface9::internal::affinity_partition_type

## Detailed Description

Defines entry point for affinity partitioner into tbb run-time library.

Definition at line 80 of file partitioner.h.

## Constructor & Destructor Documentation

## affinity_partitioner_base_v3()

tbb::internal::affinity_partitioner_base_v3::affinity_partitioner_base_v3 | ( |  | ) |

inline private

Zeros the fields.

Definition at line 89 of file partitioner.h.

: my_array(NULL), my_size(0) {}

## ~affinity_partitioner_base_v3()

tbb::internal::affinity_partitioner_base_v3::~affinity_partitioner_base_v3 | ( |  | ) |

inline private

Deallocates my_array.

Definition at line 91 of file partitioner.h.

{resize(0);}

References resize().

Here is the call graph for this function:

## Member Function Documentation

## resize()

void tbb::internal::affinity_partitioner_base_v3::resize | ( | unsigned | factor | ) |

private

Resize my_array.

Retains values if resulting size is the same.

Definition at line 157 of file task.cpp.

{
// Check factor to avoid asking for number of workers while there might be no arena.
size_t new_size = factor ? factor*governor::local_scheduler()->max_threads_in_arena() : 0;
if( new_size!=my_size ) {
if( my_array ) {
NFS_Free( my_array );
// Following two assignments must be done here for sake of exception safety.
my_array = NULL;
my_size = 0;
}
if( new_size ) {
my_array = static_cast<affinity_id*>(NFS_Allocate(new_size,sizeof(affinity_id), NULL ));
memset( my_array, 0, sizeof(affinity_id)*new_size );
my_size = new_size;
}
}
}

References tbb::internal::governor::local_scheduler(), tbb::internal::generic_scheduler::max_threads_in_arena(), my_array, my_size, new_size, tbb::internal::NFS_Allocate(), and tbb::internal::NFS_Free().

Referenced by tbb::interface9::internal::affinity_partition_type::affinity_partition_type(), and ~affinity_partitioner_base_v3().

Here is the call graph for this function:
Here is the caller graph for this function:

## Friends And Related Function Documentation

## tbb::affinity_partitioner

friend class tbb::affinity_partitioner

friend

Definition at line 81 of file partitioner.h.

## tbb::interface9::internal::affinity_partition_type

friend class tbb::interface9::internal::affinity_partition_type

friend

Definition at line 82 of file partitioner.h.

## Member Data Documentation

## my_array

affinity_id* tbb::internal::affinity_partitioner_base_v3::my_array

private

Array that remembers affinities of tree positions to affinity_id.

NULL if my_size==0.

Definition at line 85 of file partitioner.h.

Referenced by tbb::interface9::internal::affinity_partition_type::affinity_partition_type(), and resize().

## my_size

size_t tbb::internal::affinity_partitioner_base_v3::my_size

private

Number of elements in my_array.

Definition at line 87 of file partitioner.h.

Referenced by resize().

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

- partitioner.h
- task.cpp

tbb::internal::affinity_partitioner_base_v3::my_size
size_t my_size
Number of elements in my_array.
Definition: partitioner.h:87
tbb::internal::affinity_partitioner_base_v3::my_array
affinity_id * my_array
Array that remembers affinities of tree positions to affinity_id.
Definition: partitioner.h:85
new_size
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t new_size
Definition: ittnotify_static.h:163
tbb::internal::generic_scheduler::max_threads_in_arena
unsigned max_threads_in_arena()
Returns the concurrency limit of the current arena.
Definition: scheduler.h:677
tbb::internal::affinity_id
unsigned short affinity_id
An id as used for specifying affinity.
Definition: task.h:128
tbb::internal::affinity_partitioner_base_v3::resize
void __TBB_EXPORTED_METHOD resize(unsigned factor)
Resize my_array.
Definition: task.cpp:157
tbb::internal::governor::local_scheduler
static generic_scheduler * local_scheduler()
Obtain the thread-local instance of the TBB scheduler.
Definition: governor.h:129
tbb::internal::NFS_Free
void __TBB_EXPORTED_FUNC NFS_Free(void *)
Free memory allocated by NFS_Allocate.
Definition: cache_aligned_allocator.cpp:198
tbb::internal::NFS_Allocate
void *__TBB_EXPORTED_FUNC NFS_Allocate(size_t n_element, size_t element_size, void *hint)
Allocate memory on cache/sector line boundary.
Definition: cache_aligned_allocator.cpp:176

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.