Skip to content

Commit c1f95be

Browse files
committed
[pstl] Fix typos discovered by codespell
1 parent 092372d commit c1f95be

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

pstl/include/pstl/internal/omp/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace __omp_backend
4444
inline void
4545
__cancel_execution()
4646
{
47-
// TODO: Figure out how to make cancelation work.
47+
// TODO: Figure out how to make cancellation work.
4848
}
4949

5050
//------------------------------------------------------------------------

pstl/include/pstl/internal/parallel_backend_tbb.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ __parallel_transform_reduce(__pstl::__internal::__tbb_backend_tag, _ExecutionPol
198198
_Up __u, _Tp __init, _Cp __combine, _Rp __brick_reduce)
199199
{
200200
__tbb_backend::__par_trans_red_body<_Index, _Up, _Tp, _Cp, _Rp> __body(__u, __init, __combine, __brick_reduce);
201-
// The grain size of 3 is used in order to provide mininum 2 elements for each body
201+
// The grain size of 3 is used in order to provide minimum 2 elements for each body
202202
tbb::this_task_arena::isolate(
203203
[__first, __last, &__body]() { tbb::parallel_reduce(tbb::blocked_range<_Index>(__first, __last, 3), __body); });
204204
return __body.sum();
@@ -727,7 +727,7 @@ class __merge_func
727727
_SizeType _M_zs;
728728
_Compare _M_comp;
729729
_LeafMerge _M_leaf_merge;
730-
_SizeType _M_nsort; //number of elements to be sorted for partial_sort alforithm
730+
_SizeType _M_nsort; //number of elements to be sorted for partial_sort algorithm
731731

732732
static const _SizeType __merge_cut_off = _PSTL_MERGE_CUT_OFF;
733733

@@ -1101,7 +1101,7 @@ class __stable_sort_func
11011101
_Compare _M_comp;
11021102
_LeafSort _M_leaf_sort;
11031103
bool _M_root;
1104-
_SizeType _M_nsort; //zero or number of elements to be sorted for partial_sort alforithm
1104+
_SizeType _M_nsort; //zero or number of elements to be sorted for partial_sort algorithm
11051105

11061106
public:
11071107
__stable_sort_func(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _RandomAccessIterator2 __zs,
@@ -1166,7 +1166,7 @@ __parallel_stable_sort(__pstl::__internal::__tbb_backend_tag, _ExecutionPolicy&&
11661166
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _DifferenceType;
11671167
const _DifferenceType __n = __xe - __xs;
11681168
if (__nsort == __n)
1169-
__nsort = 0; // 'partial_sort' becames 'sort'
1169+
__nsort = 0; // 'partial_sort' becomes 'sort'
11701170

11711171
const _DifferenceType __sort_cut_off = _PSTL_STABLE_SORT_CUT_OFF;
11721172
if (__n > __sort_cut_off)

pstl/test/std/algorithms/alg.nonmodifying/equal.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct test_one_policy
108108
// testing bool
109109
EXPECT_TRUE(is_true_equal == actual, "result for equal for random-access iterator, bool");
110110

111-
//add C++14 equal symantics tests
111+
//add C++14 equal semantics tests
112112
//add more cases for inCopy size less than in
113113
#if CPP14_ENABLED
114114
auto actualr14 = std::equal(in.cbegin(), in.cend(), inCopy.cbegin(), inCopy.cend());

pstl/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct sequence_wrapper
9292
return;
9393
seq[at] = value;
9494

95-
//Producing serveral red herrings
95+
//Producing several red herrings
9696
for (std::size_t i = at + 1; i < seq.size(); i += 1 + TestUtils::HashBits(i, 5))
9797
seq[i] = value;
9898
}

pstl/test/std/numerics/numeric.ops/scan.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ main()
191191
Matrix2x2<int32_t>(-666, 666));
192192
#endif
193193

194-
// Since the implict "+" forms of the scan delegate to the generic forms,
194+
// Since the implicit "+" forms of the scan delegate to the generic forms,
195195
// there's little point in using a highly restricted type, so just use double.
196196
test_with_plus<float64_t>(inclusive ? 0.0 : -1.0, -666.0,
197197
[](uint32_t k) { return float64_t((k % 991 + 1) ^ (k % 997 + 2)); });

pstl/test/support/utils.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ expect_equal(Iterator1 expected_first, Iterator2 actual_first, Size n, const cha
133133

134134
// ForwardIterator is like type Iterator, but restricted to be a forward iterator.
135135
// Only the forward iterator signatures that are necessary for tests are present.
136-
// Post-increment in particular is deliberatly omitted since our templates should avoid using it
136+
// Post-increment in particular is deliberately omitted since our templates should avoid using it
137137
// because of efficiency considerations.
138138
template <typename Iterator, typename IteratorTag>
139139
class ForwardIterator
@@ -252,40 +252,40 @@ struct MemoryChecker {
252252
MemoryChecker(MemoryChecker&& other) : _value(other.value()) {
253253
// check for EXPECT_TRUE(state() != alive_state, ...) has not been done since
254254
// compiler can optimize out the move ctor call that results in false positive failure
255-
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(MemoryChecker&&): attemp to construct an object from non-existing object");
255+
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(MemoryChecker&&): attempt to construct an object from non-existing object");
256256
// set constructed state and increment counter for living object
257257
inc_alive_objects();
258258
_state = alive_state;
259259
}
260260
MemoryChecker(const MemoryChecker& other) : _value(other.value()) {
261261
// check for EXPECT_TRUE(state() != alive_state, ...) has not been done since
262262
// compiler can optimize out the copy ctor call that results in false positive failure
263-
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(const MemoryChecker&): attemp to construct an object from non-existing object");
263+
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(const MemoryChecker&): attempt to construct an object from non-existing object");
264264
// set constructed state and increment counter for living object
265265
inc_alive_objects();
266266
_state = alive_state;
267267
}
268268
MemoryChecker& operator=(MemoryChecker&& other) {
269269
// check if we do not assign over uninitialized memory
270-
EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): attemp to assign to non-existing object");
271-
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): attemp to assign from non-existing object");
270+
EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): attempt to assign to non-existing object");
271+
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): attempt to assign from non-existing object");
272272
// just assign new value, counter is the same, state is the same
273273
_value = other.value();
274274

275275
return *this;
276276
}
277277
MemoryChecker& operator=(const MemoryChecker& other) {
278278
// check if we do not assign over uninitialized memory
279-
EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): attemp to assign to non-existing object");
280-
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): attemp to assign from non-existing object");
279+
EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): attempt to assign to non-existing object");
280+
EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): attempt to assign from non-existing object");
281281
// just assign new value, counter is the same, state is the same
282282
_value = other.value();
283283

284284
return *this;
285285
}
286286
~MemoryChecker() {
287287
// check if we do not double destruct the object
288-
EXPECT_TRUE(state() == alive_state, "wrong effect from ~MemoryChecker(): attemp to destroy non-existing object");
288+
EXPECT_TRUE(state() == alive_state, "wrong effect from ~MemoryChecker(): attempt to destroy non-existing object");
289289
// set destructed state and decrement counter for living object
290290
static_cast<volatile std::int64_t&>(_state) = dead_state;
291291
dec_alive_objects();
@@ -685,7 +685,7 @@ multiply_matrix(const Matrix2x2<T>& left, const Matrix2x2<T>& right)
685685
//============================================================================
686686
// Adapters for creating different types of iterators.
687687
//
688-
// In this block we implemented some adapters for creating differnet types of iterators.
688+
// In this block we implemented some adapters for creating different types of iterators.
689689
// It's needed for extending the unit testing of Parallel STL algorithms.
690690
// We have adapters for iterators with different tags (forward_iterator_tag, bidirectional_iterator_tag), reverse iterators.
691691
// The input iterator should be const or non-const, non-reverse random access iterator.

0 commit comments

Comments
 (0)