From ee715628d10f734aef0e42741ada5a80dc84230d Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Wed, 16 Aug 2023 08:51:06 -0500 Subject: [PATCH] Corrected typo in exception text --- dpctl/tensor/_usmarray.pyx | 2 +- .../source/boolean_advanced_indexing.cpp | 12 ++++++------ .../libtensor/source/boolean_reductions.hpp | 4 ++-- .../source/copy_and_cast_usm_to_usm.cpp | 4 ++-- .../libtensor/source/copy_for_reshape.cpp | 4 ++-- .../copy_numpy_ndarray_into_usm_ndarray.cpp | 4 ++-- .../libtensor/source/elementwise_functions.hpp | 18 +++++++++--------- .../tensor/libtensor/source/sum_reductions.cpp | 4 ++-- dpctl/tensor/libtensor/source/where.cpp | 4 ++-- dpctl/tests/test_usm_ndarray_ctor.py | 2 +- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/dpctl/tensor/_usmarray.pyx b/dpctl/tensor/_usmarray.pyx index 98986d84d6..1336063323 100644 --- a/dpctl/tensor/_usmarray.pyx +++ b/dpctl/tensor/_usmarray.pyx @@ -325,7 +325,7 @@ cdef class usm_ndarray: if (_offset + ary_min_displacement < 0 or (_offset + ary_max_displacement + 1) * itemsize > _buffer.nbytes): self._cleanup() - raise ValueError(("buffer='{}' can not accomodate " + raise ValueError(("buffer='{}' can not accommodate " "the requested array.").format(buffer)) is_fp64 = (typenum == UAR_DOUBLE or typenum == UAR_CDOUBLE) is_fp16 = (typenum == UAR_HALF) diff --git a/dpctl/tensor/libtensor/source/boolean_advanced_indexing.cpp b/dpctl/tensor/libtensor/source/boolean_advanced_indexing.cpp index 0c9f8656d0..0dd63fe973 100644 --- a/dpctl/tensor/libtensor/source/boolean_advanced_indexing.cpp +++ b/dpctl/tensor/libtensor/source/boolean_advanced_indexing.cpp @@ -387,14 +387,14 @@ py_extract(dpctl::tensor::usm_ndarray src, // ensure that dst is sufficiently ample auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < static_cast(ortho_nelems * masked_dst_nelems)) { throw py::value_error( "Memory addressed by the destination array can not " - "accomodate all the " + "accommodate all the " "array elements."); } } @@ -716,14 +716,14 @@ py_place(dpctl::tensor::usm_ndarray dst, // ensure that dst is sufficiently ample auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < static_cast(ortho_nelems * masked_dst_nelems)) { throw py::value_error( "Memory addressed by the destination array can not " - "accomodate all the " + "accommodate all the " "array elements."); } } @@ -999,14 +999,14 @@ py_nonzero(dpctl::tensor::usm_ndarray // ensure that dst is sufficiently ample auto indexes_offsets = indexes.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(indexes_offsets.second - indexes_offsets.first); if (range + 1 < static_cast(nz_elems * _ndim)) { throw py::value_error( "Memory addressed by the destination array can not " - "accomodate all the array elements."); + "accommodate all the array elements."); } } diff --git a/dpctl/tensor/libtensor/source/boolean_reductions.hpp b/dpctl/tensor/libtensor/source/boolean_reductions.hpp index 7b00932a8c..f0b6881dc8 100644 --- a/dpctl/tensor/libtensor/source/boolean_reductions.hpp +++ b/dpctl/tensor/libtensor/source/boolean_reductions.hpp @@ -102,14 +102,14 @@ py_boolean_reduction(dpctl::tensor::usm_ndarray src, // ensure that dst is sufficiently ample auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < static_cast(dst_nelems)) { throw py::value_error( "Memory addressed by the destination array can not " - "accomodate all the array elements."); + "accommodate all the array elements."); } } diff --git a/dpctl/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp b/dpctl/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp index 57386e736f..383385e238 100644 --- a/dpctl/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp +++ b/dpctl/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp @@ -100,14 +100,14 @@ copy_usm_ndarray_into_usm_ndarray(dpctl::tensor::usm_ndarray src, return std::make_pair(sycl::event(), sycl::event()); } - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { auto dst_offsets = dst.get_minmax_offsets(); size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < src_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } diff --git a/dpctl/tensor/libtensor/source/copy_for_reshape.cpp b/dpctl/tensor/libtensor/source/copy_for_reshape.cpp index 7f4b8d718c..8edf982b16 100644 --- a/dpctl/tensor/libtensor/source/copy_for_reshape.cpp +++ b/dpctl/tensor/libtensor/source/copy_for_reshape.cpp @@ -88,14 +88,14 @@ copy_usm_ndarray_for_reshape(dpctl::tensor::usm_ndarray src, return std::make_pair(sycl::event(), sycl::event()); } - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { auto dst_offsets = dst.get_minmax_offsets(); py::ssize_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < src_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } diff --git a/dpctl/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp b/dpctl/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp index 0464a14cd3..4097e76178 100644 --- a/dpctl/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp +++ b/dpctl/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp @@ -89,14 +89,14 @@ void copy_numpy_ndarray_into_usm_ndarray( } auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements of source + // destination must be ample enough to accommodate all elements of source // array { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < src_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } diff --git a/dpctl/tensor/libtensor/source/elementwise_functions.hpp b/dpctl/tensor/libtensor/source/elementwise_functions.hpp index 453992220a..6c3543fb76 100644 --- a/dpctl/tensor/libtensor/source/elementwise_functions.hpp +++ b/dpctl/tensor/libtensor/source/elementwise_functions.hpp @@ -113,15 +113,15 @@ py_unary_ufunc(dpctl::tensor::usm_ndarray src, return std::make_pair(sycl::event(), sycl::event()); } - // ensure that output is ample enough to accomodate all elements + // ensure that output is ample enough to accommodate all elements auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < src_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } @@ -366,15 +366,15 @@ std::pair py_binary_ufunc( return std::make_pair(sycl::event(), sycl::event()); } - // ensure that output is ample enough to accomodate all elements + // ensure that output is ample enough to accommodate all elements auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < src_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } @@ -664,15 +664,15 @@ py_binary_inplace_ufunc(dpctl::tensor::usm_ndarray lhs, return std::make_pair(sycl::event(), sycl::event()); } - // ensure that output is ample enough to accomodate all elements + // ensure that output is ample enough to accommodate all elements auto lhs_offsets = lhs.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(lhs_offsets.second - lhs_offsets.first); if (range + 1 < rhs_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } diff --git a/dpctl/tensor/libtensor/source/sum_reductions.cpp b/dpctl/tensor/libtensor/source/sum_reductions.cpp index 1907bcac2e..3502a81a0e 100644 --- a/dpctl/tensor/libtensor/source/sum_reductions.cpp +++ b/dpctl/tensor/libtensor/source/sum_reductions.cpp @@ -142,14 +142,14 @@ std::pair py_sum_over_axis( throw py::value_error("Arrays index overlapping segments of memory"); } - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { auto dst_offsets = dst.get_minmax_offsets(); size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < dst_nelems) { throw py::value_error( - "Destination array can not accomodate all the " + "Destination array can not accommodate all the " "elements of source array."); } } diff --git a/dpctl/tensor/libtensor/source/where.cpp b/dpctl/tensor/libtensor/source/where.cpp index 8f47381cf6..06c6ca4a25 100644 --- a/dpctl/tensor/libtensor/source/where.cpp +++ b/dpctl/tensor/libtensor/source/where.cpp @@ -132,14 +132,14 @@ py_where(dpctl::tensor::usm_ndarray condition, // ensure that dst is sufficiently ample auto dst_offsets = dst.get_minmax_offsets(); - // destination must be ample enough to accomodate all elements + // destination must be ample enough to accommodate all elements { size_t range = static_cast(dst_offsets.second - dst_offsets.first); if (range + 1 < static_cast(nelems)) { throw py::value_error( "Memory addressed by the destination array can not " - "accomodate all the " + "accommodate all the " "array elements."); } } diff --git a/dpctl/tests/test_usm_ndarray_ctor.py b/dpctl/tests/test_usm_ndarray_ctor.py index 01135cb7c3..34bda2651a 100644 --- a/dpctl/tests/test_usm_ndarray_ctor.py +++ b/dpctl/tests/test_usm_ndarray_ctor.py @@ -1602,7 +1602,7 @@ def test_arange(dt): elif np.issubdtype(dt, np.complexfloating): assert complex(X[47]) == 47.0 + 0.0j - # choose size larger than maximal value that u1/u2 can accomodate + # choose size larger than maximal value that u1/u2 can accommodate sz = int(dpt.iinfo(dpt.int8).max) X1 = dpt.arange(sz + 1, dtype=dt, sycl_queue=q) assert X1.shape == (sz + 1,)