Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::random_lane_selector Struct Reference

#include <task_stream_extended.h>

Inheritance diagram for tbb::internal::random_lane_selector:
Collaboration diagram for tbb::internal::random_lane_selector:

Public Member Functions

 random_lane_selector (FastRandom &random)
 
unsigned operator() (unsigned out_of) const
 
- Public Member Functions inherited from tbb::internal::no_copy
 no_copy (const no_copy &)=delete
 
 no_copy ()=default
 

Private Attributes

FastRandommy_random
 

Detailed Description

Definition at line 83 of file task_stream_extended.h.

Constructor & Destructor Documentation

◆ random_lane_selector()

tbb::internal::random_lane_selector::random_lane_selector ( FastRandom random)
inline

Definition at line 90 of file task_stream_extended.h.

90 : my_random( random ) {}

Member Function Documentation

◆ operator()()

unsigned tbb::internal::random_lane_selector::operator() ( unsigned  out_of) const
inline

Definition at line 91 of file task_stream_extended.h.

91  {
92  __TBB_ASSERT( ((out_of-1) & out_of) == 0, "number of lanes is not power of two." );
93  return my_random.get() & (out_of-1);
94  }
unsigned short get()
Get a random number.
Definition: tbb_misc.h:146
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, tbb::internal::FastRandom::get(), and my_random.

Here is the call graph for this function:

Member Data Documentation

◆ my_random

FastRandom& tbb::internal::random_lane_selector::my_random
private

Definition at line 96 of file task_stream_extended.h.

Referenced by operator()().


The documentation for this struct 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.