| 70 | * Collection of preferences set by the function regarding how to split a given workload |
| 71 | */ |
| 72 | class Hints |
| 73 | { |
| 74 | public: |
| 75 | /** Constructor |
| 76 | * |
| 77 | * @param[in] split_dimension Dimension along which to split the kernel's execution window. |
| 78 | * @param[in] strategy (Optional) Split strategy. |
| 79 | * @param[in] threshold (Optional) Dynamic scheduling capping threshold. |
| 80 | */ |
| 81 | Hints(unsigned int split_dimension, StrategyHint strategy = StrategyHint::STATIC, int threshold = 0) |
| 82 | : _split_dimension(split_dimension), _strategy(strategy), _threshold(threshold) |
| 83 | { |
| 84 | } |
| 85 | /** Set the split_dimension hint |
| 86 | * |
| 87 | * @param[in] split_dimension Dimension along which to split the kernel's execution window. |
| 88 | * |
| 89 | * @return the Hints object |
| 90 | */ |
| 91 | Hints &set_split_dimension(unsigned int split_dimension) |
| 92 | { |
| 93 | _split_dimension = split_dimension; |
| 94 | return *this; |
| 95 | } |
| 96 | /** Return the prefered split dimension |
| 97 | * |
| 98 | * @return The split dimension |
| 99 | */ |
| 100 | unsigned int split_dimension() const |
| 101 | { |
| 102 | return _split_dimension; |
| 103 | } |
| 104 | |
| 105 | /** Set the strategy hint |
| 106 | * |
| 107 | * @param[in] strategy Prefered strategy to use to split the workload |
| 108 | * |
| 109 | * @return the Hints object |
| 110 | */ |
| 111 | Hints &set_strategy(StrategyHint strategy) |
| 112 | { |
| 113 | _strategy = strategy; |
| 114 | return *this; |
| 115 | } |
| 116 | /** Return the prefered strategy to use to split workload. |
| 117 | * |
| 118 | * @return The strategy |
| 119 | */ |
| 120 | StrategyHint strategy() const |
| 121 | { |
| 122 | return _strategy; |
| 123 | } |
| 124 | /** Return the granule capping threshold to be used by dynamic scheduling. |
| 125 | * |
| 126 | * @return The capping threshold |
| 127 | */ |
| 128 | int threshold() const |
| 129 | { |
no outgoing calls
no test coverage detected