From e5cbe500d20311f3467f8814392c09c7e523d6ff Mon Sep 17 00:00:00 2001 From: Aleksei Fedotov Date: Mon, 28 Feb 2022 10:34:08 +0300 Subject: [PATCH] Actualize documentation about proportional splitting constructor in Range (#728) Actualize documentation about proportional splitting Signed-off-by: Fedotov, Aleksei --- ..._Topic_Other_Kinds_of_Iteration_Spaces.rst | 24 ++++------ test/tbb/test_partitioner.h | 44 ------------------- 2 files changed, 9 insertions(+), 59 deletions(-) diff --git a/doc/main/tbb_userguide/Advanced_Topic_Other_Kinds_of_Iteration_Spaces.rst b/doc/main/tbb_userguide/Advanced_Topic_Other_Kinds_of_Iteration_Spaces.rst index e5d572c3e4..3352dd8d32 100644 --- a/doc/main/tbb_userguide/Advanced_Topic_Other_Kinds_of_Iteration_Spaces.rst +++ b/doc/main/tbb_userguide/Advanced_Topic_Other_Kinds_of_Iteration_Spaces.rst @@ -4,15 +4,13 @@ Advanced Topic: Other Kinds of Iteration Spaces =============================================== -The examples so far have used the class ``blocked_range`` to specify -ranges. This class is useful in many situations, but it does not fit -every situation. You can use |full_name| -to define your own iteration space objects. The object must specify how -it can be split into subspaces by providing a basic splitting -constructor, an optional proportional splitting constructor (accompanied -with a trait value that enables its usage), and two predicate methods. -If your class is called ``R``, the methods and constructors should be as -follows: +The examples so far have used the class ``blocked_range`` to specify ranges. +This class is useful in many situations, but it does not fit every situation. +You can use |full_name| to define your own iteration space objects. The object +must specify how it can be split into subspaces by providing a basic splitting +constructor, an optional proportional splitting constructor, and two predicate +methods. If your class is called ``R``, the methods and constructors should be +as follows: :: @@ -25,10 +23,8 @@ follows: bool is_divisible() const; // Splits r into subranges r and *this R( R& r, split ); - // Splits r into subranges r and *this in proportion p + // (optional) Splits r into subranges r and *this in proportion p R( R& r, proportional_split p ); - // Allows usage of proportional splitting constructor - static const bool is_splittable_in_proportion = true; ... }; @@ -60,9 +56,7 @@ constructor is optional and takes the second argument of type that return the values of the proportion. These values should be used to split ``r`` accordingly, so that the updated ``r`` corresponds to the left part of the proportion, and the constructed object corresponds to -the right part. The proportional splitting constructor will be used only -if the static constant ``is_splittable_in_proportion`` is defined in the -class and assigned the value of ``true``. +the right part. Both splitting constructors should guarantee that the updated ``r`` part diff --git a/test/tbb/test_partitioner.h b/test/tbb/test_partitioner.h index 8e52503141..93a02a7a6f 100644 --- a/test/tbb/test_partitioner.h +++ b/test/tbb/test_partitioner.h @@ -481,50 +481,6 @@ class SplitConstructorAssertedRange { } }; -/* - * Possible use cases are: - * ------------------------------------------------------------------------------------------------------------- - * Range# is_splittable_in_proportion Range proportional ctor Used partitioner Result Effect - * ------------------------------------------------------------------------------------------------------------- - * 1 true available proportional pMN, r(p), part(p) - * ------------------------------------------------------------------------------------------------------------- - * 2 false available proportional p11, r(p), part(p) - * ------------------------------------------------------------------------------------------------------------- - * 3 not defined available proportional p11, r(p), part(p) - * ------------------------------------------------------------------------------------------------------------- - * 4 true not available proportional pMN, r(s), part(p) * - * ------------------------------------------------------------------------------------------------------------- - * 5 false not available proportional p11, r(s), part(p) - * ------------------------------------------------------------------------------------------------------------- - * 6 not defined not available proportional p11, r(s), part(p) - * ------------------------------------------------------------------------------------------------------------- - * 1 true available simple s, r(s), part(s) - * ------------------------------------------------------------------------------------------------------------- - * 2 false available simple s, r(s), part(s) - * ------------------------------------------------------------------------------------------------------------- - * 3 not defined available simple s, r(s), part(s) - * ------------------------------------------------------------------------------------------------------------- - * 4 true not available simple s, r(s), part(s) - * ------------------------------------------------------------------------------------------------------------- - * 5 false not available simple s, r(s), part(s) - * ------------------------------------------------------------------------------------------------------------- - * 6 not defined not available simple s, r(s), part(s) - * ------------------------------------------------------------------------------------------------------------- - * - * Legend: - * proportional - with proportional splits (e.g. affinity_partitioner) - * simple - without proportional splits (e.g. simple_partitioner, auto_partitioner) - * pMN - proportional_split object with proportion M to N is created. (p11 - proportion 1 to 1) - * s - split object is created - * r(p) - range's proportional split constructor is called - * r(s) - range's ordinary split constructor is called - * part(p) - partitioner's proportional split constructor is called - * part(s) - partitioner's ordinary split constructor is called - * * - incorrect split behavior is possible (e.g. partitioner divides at an arbitrary ratio while - * range divides into halves) - */ - - // proportional_split ctor defined class Range1: public SplitConstructorAssertedRange { public: