Skip to content

Spelling fixes pointed out by codespell #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dpctl/_sycl_context.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ cdef class SyclContext(_SyclContext):
ctx = dpctl.SyclContext()
print(ctx.get_devices())

- Invoking the constuctor with a specific filter string that creates a
- Invoking the constructor with a specific filter string that creates a
context for the device corresponding to the filter string.

:Example:
Expand All @@ -127,7 +127,7 @@ cdef class SyclContext(_SyclContext):
d = ctx.get_devices()[0]
assert(d.is_gpu)

- Invoking the constuctor with a :class:`dpctl.SyclDevice` object
- Invoking the constructor with a :class:`dpctl.SyclDevice` object
creates a context for that device.

:Example:
Expand All @@ -141,7 +141,7 @@ cdef class SyclContext(_SyclContext):
d = ctx.get_devices()[0]
assert(d.is_gpu)

- Invoking the constuctor with a list of :class:`dpctl.SyclDevice`
- Invoking the constructor with a list of :class:`dpctl.SyclDevice`
objects creates a common context for all the devices. This
constructor call is especially useful when creation a context for
multiple sub-devices.
Expand All @@ -159,7 +159,7 @@ cdef class SyclContext(_SyclContext):
ctx = dpctl.SyclContext(sub_devices)
assert(len(ctx.get_devices) == len(sub_devices))

- Invoking the constuctor with a named ``PyCapsule`` with name
- Invoking the constructor with a named ``PyCapsule`` with name
**"SyclContextRef"** that carries a pointer to a ``sycl::context``
object. The capsule will be renamed upon successful consumption
to ensure one-time use. A new named capsule can be constructed by
Expand Down Expand Up @@ -430,7 +430,7 @@ cdef class SyclContext(_SyclContext):
return num_devs
else:
raise ValueError(
"An error was encountered quering the number of devices "
"An error was encountered querying the number of devices "
"associated with this context"
)

Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ cdef class SyclDevice(_SyclDevice):
def create_sub_devices(self, **kwargs):
"""create_sub_devices(partition=parition_spec)
Creates a list of sub-devices by partitioning a root device based on the
provided partion specifier.
provided partition specifier.

A partition specifier must be provided using a "partition"
keyword argument. Possible values for the specifier are: an int, a
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_event.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ cdef class SyclEvent(_SyclEvent):
# Create a default SyclEvent
e = dpctl.SyclEvent()

- Invoking the constuctor with a named ``PyCapsule`` with name
- Invoking the constructor with a named ``PyCapsule`` with name
**"SyclEventRef"** that carries a pointer to a ``sycl::event``
object. The capsule will be renamed upon successful consumption
to ensure one-time use. A new named capsule can be constructed by
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_queue.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ cdef class SyclQueue(_SyclQueue):
# create a queue for each sub-device using the common context
queues = [dpctl.SyclQueue(ctx, sub_d) for sub_d in sub_devices]

- Invoking the constuctor with a named ``PyCapsule`` with the name
- Invoking the constructor with a named ``PyCapsule`` with the name
**"SyclQueueRef"** that carries a pointer to a ``sycl::queue``
object. The capsule will be renamed upon successful consumption
to ensure one-time use. A new named capsule can be constructed by
Expand Down
6 changes: 3 additions & 3 deletions dpctl/_sycl_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class SyclTimer:
q = dpctl.SyclQueue(property='enable_profiling')

# create the timer
miliseconds_sc = 1e-3
timer = dpctl.SyclTimer(time_scale = miliseconds_sc)
milliseconds_sc = 1e-3
timer = dpctl.SyclTimer(time_scale = milliseconds_sc)

# use the timer
with timer(queue=q):
code_block

# retrieve elapsed times in miliseconds
# retrieve elapsed times in milliseconds
sycl_dt, wall_dt = timer.dt

Remark:
Expand Down
4 changes: 2 additions & 2 deletions dpctl/apis/include/dpctl4pybind11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,12 @@ class usm_memory : public py::object
return nullptr;
}

auto convertor =
auto converter =
::dpctl::detail::dpctl_capi::get().as_usm_memory_pyobj();

py::object res;
try {
res = convertor(py::handle(o));
res = converter(py::handle(o));
} catch (const py::error_already_set &e) {
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion dpctl/memory/_memory.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cdef void copy_via_host(void *dest_ptr, SyclQueue dest_queue,
void *src_ptr, SyclQueue src_queue, size_t nbytes):
"""
Copies `nbytes` bytes from `src_ptr` USM memory to
`dest_ptr` USM memory using host as the intemediary.
`dest_ptr` USM memory using host as the intermediary.

This is useful when `src_ptr` and `dest_ptr` are bound to incompatible
SYCL contexts.
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/_copy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _copy_to_numpy(ary):

def _copy_from_numpy(np_ary, usm_type="device", sycl_queue=None):
"Copies numpy array `np_ary` into a new usm_ndarray"
# This may peform a copy to meet stated requirements
# This may perform a copy to meet stated requirements
Xnp = np.require(np_ary, requirements=["A", "E"])
alloc_q = normalize_queue_device(sycl_queue=sycl_queue, device=None)
dt = Xnp.dtype
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def sycl_context(self):
@property
def sycl_device(self):
"""
:class:`dpctl.SyclDevice` targed by this :class:`.Device`.
:class:`dpctl.SyclDevice` targeted by this :class:`.Device`.
"""
return self.sycl_queue_.sycl_device

Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/_elementwise_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@
_subtract_docstring_ = """
subtract(x1, x2, out=None, order='K')

Calculates the difference bewteen each element `x1_i` of the input
Calculates the difference between each element `x1_i` of the input
array `x1` and the respective element `x2_i` of the input array `x2`.

Args:
Expand Down
4 changes: 2 additions & 2 deletions dpctl/tensor/_manipulation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def broadcast_to(X, shape):
raise TypeError(f"Expected usm_ndarray type, got {type(X)}.")

# Use numpy.broadcast_to to check the validity of the input
# parametr 'shape'. Raise ValueError if 'X' is not compatible
# parameter 'shape'. Raise ValueError if 'X' is not compatible
# with 'shape' according to NumPy's broadcasting rules.
new_array = np.broadcast_to(
np.broadcast_to(np.empty(tuple(), dtype="u1"), X.shape), shape
Expand Down Expand Up @@ -757,7 +757,7 @@ def iinfo(dtype):

Returns:
iinfo_object:
An object with the followign attributes
An object with the following attributes
* bits: int
number of bits occupied by the data type
* max: int
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def set_print_options(
suppress (bool, optional): If `True,` numbers equal to zero
in the current precision will print as zero.
Default: `False`.
nanstr (str, optional): String used to repesent nan.
nanstr (str, optional): String used to represent nan.
Raises `TypeError` if nanstr is not a string.
Default: `"nan"`.
infstr (str, optional): String used to represent infinity.
Expand Down
4 changes: 2 additions & 2 deletions dpctl/tensor/_slicing.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _basic_slice_meta(ind, shape : tuple, strides : tuple, offset : int):
Give basic slicing index `ind` and array layout information produce
a 5-tuple (resulting_shape, resulting_strides, resulting_offset,
advanced_ind, resulting_advanced_ind_pos)
used to contruct a view into underlying array over which advanced
used to construct a view into underlying array over which advanced
indexing, if any, is to be performed.

Raises IndexError for invalid index `ind`.
Expand Down Expand Up @@ -201,7 +201,7 @@ def _basic_slice_meta(ind, shape : tuple, strides : tuple, offset : int):
raise TypeError
if ellipses_count > 1:
raise IndexError(
"an index can only have a sinlge ellipsis ('...')")
"an index can only have a single ellipsis ('...')")
if axes_referenced > len(shape):
raise IndexError(
"too many indices for an array, array is "
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/_stride_utils.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cdef int _from_input_shape_strides(
nelems - Number of elements in array
min_disp = min( dot(strides, index), index for shape)
max_disp = max( dor(strides, index), index for shape)
contig = enumation for array contiguity
contig = enumeration for array contiguity
Returns: 0 on success, error code otherwise.
On success pointers point to allocated arrays,
Otherwise they are set to NULL
Expand Down
10 changes: 5 additions & 5 deletions dpctl/tensor/_usmarray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ cdef class usm_ndarray:
cdef char *ary_ptr = NULL
if (not isinstance(self.base_, dpmem._memory._Memory)):
raise InternalUSMArrayError(
"Invalid instance of usm_ndarray ecountered. "
"Invalid instance of usm_ndarray encountered. "
"Private field base_ has an unexpected type {}.".format(
type(self.base_)
)
Expand Down Expand Up @@ -566,7 +566,7 @@ cdef class usm_ndarray:
elif (self.flags_ & USM_ARRAY_F_CONTIGUOUS):
return _f_contig_strides(self.nd_, self.shape_)
else:
raise ValueError("Inconsitent usm_ndarray data")
raise ValueError("Inconsistent usm_ndarray data")

@property
def flags(self):
Expand Down Expand Up @@ -653,7 +653,7 @@ cdef class usm_ndarray:

@property
def T(self):
""" Returns tranposed array for 2D array, raises `ValueError`
""" Returns transposed array for 2D array, raises `ValueError`
otherwise.
"""
if self.nd_ == 2:
Expand Down Expand Up @@ -1376,8 +1376,8 @@ cdef api object UsmNDArray_MakeSimpleFromMemory(
QRef: DPCTLSyclQueueRef associated with the allocation
offset: distance between element with zero multi-index and the
start of allocation
oder: Memory layout of the array. Use 'C' for C-contiguous or
row-major layout; 'F' for F-contiguous or column-major layout
order: Memory layout of the array. Use 'C' for C-contiguous or
row-major layout; 'F' for F-contiguous or column-major layout
Returns:
Created usm_ndarray instance
"""
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/include/dlpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ The header `dlpack.h` downloaded from `https://github.com/dmlc/dlpack.git` remot

The file can also be viewed using github web interface at https://github.com/dmlc/dlpack/blob/e2bdd3bee8cb6501558042633fa59144cc8b7f5f/include/dlpack/dlpack.h

License file was retrived from https://github.com/dmlc/dlpack/blob/main/LICENSE
License file was retrieved from https://github.com/dmlc/dlpack/blob/main/LICENSE
2 changes: 1 addition & 1 deletion dpctl/tensor/include/dlpack/dlpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ typedef struct {
* `byte_offset` field should be used to point to the beginning of the data.
*
* Note that as of Nov 2021, multiply libraries (CuPy, PyTorch, TensorFlow,
* TVM, perhaps others) do not adhere to this 256 byte aligment requirement
* TVM, perhaps others) do not adhere to this 256 byte alignment requirement
* on CPU/CUDA/ROCm, and always use `byte_offset=0`. This must be fixed
* (after which this note will be updated); at the moment it is recommended
* to not rely on the data pointer being correctly aligned.
Expand Down
4 changes: 2 additions & 2 deletions dpctl/tensor/libtensor/include/kernels/copy_and_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ typedef sycl::event (*copy_and_cast_generic_fn_ptr_t)(
* @brief Generic function to copy `nelems` elements from `src` usm_ndarray to
`dst` usm_ndarray while casting from `srcTy` to `dstTy`.

Both arrays have array dimensionality specied via argument `nd`. The
Both arrays have array dimensionality specified via argument `nd`. The
`shape_and_strides` is kernel accessible USM array of length `3*nd`, where the
first `nd` elements encode common shape, second `nd` elements contain strides
of `src` array, and the trailing `nd` elements contain strides of `dst` array.
Expand Down Expand Up @@ -696,7 +696,7 @@ typedef sycl::event (*copy_for_reshape_fn_ptr_t)(
* @param src_nd Array dimension of the source array
* @param dst_nd Array dimension of the destination array
* @param packed_shapes_and_strides Kernel accessible USM array of size
* `2*src_nd + 2*dst_nd` with contant `[src_shape, src_strides, dst_shape,
* `2*src_nd + 2*dst_nd` with content `[src_shape, src_strides, dst_shape,
* dst_strides]`.
* @param src_p Typeless USM pointer to the buffer of the source array
* @param dst_p Typeless USM pointer to the buffer of the destination array
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/include/kernels/reductions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ sycl::event sum_reduction_over_group_temps_strided_impl(

size_t reductions_per_wi(preferrered_reductions_per_wi);
if (reduction_nelems <= preferrered_reductions_per_wi * max_wg) {
// reduction only requries 1 work-group, can output directly to res
// reduction only requires 1 work-group, can output directly to res
sycl::event comp_ev = exec_q.submit([&](sycl::handler &cgh) {
cgh.depends_on(depends);

Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/include/utils/offset_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ device_allocate_and_pack(sycl::queue q,
{

// memory transfer optimization, use USM-host for temporary speeds up
// tranfer to device, especially on dGPUs
// transfer to device, especially on dGPUs
using usm_host_allocatorT =
sycl::usm_allocator<indT, sycl::usm::alloc::host>;
using shT = std::vector<indT, usm_host_allocatorT>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void copy_numpy_ndarray_into_usm_ndarray(
simplified_dst_strides.push_back(1);
}

// Minumum and maximum element offsets for source np.ndarray
// Minimum and maximum element offsets for source np.ndarray
py::ssize_t npy_src_min_nelem_offset(src_offset);
py::ssize_t npy_src_max_nelem_offset(src_offset);
for (int i = 0; i < nd; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/source/device_support_queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::string _default_device_fp_type(sycl::device d)

std::string _default_device_int_type(sycl::device)
{
return "l"; // code for numpy.dtype('long') to be consisent
return "l"; // code for numpy.dtype('long') to be consistent
// with NumPy's default integer type across
// platforms.
}
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/source/tensor_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ PYBIND11_MODULE(_tensor_impl, m)

m.def("_copy_numpy_ndarray_into_usm_ndarray",
&copy_numpy_ndarray_into_usm_ndarray,
"Copy fom numpy array `src` into usm_ndarray `dst` synchronously.",
"Copy from numpy array `src` into usm_ndarray `dst` synchronously.",
py::arg("src"), py::arg("dst"), py::arg("sycl_queue"),
py::arg("depends") = py::list());

Expand Down
2 changes: 1 addition & 1 deletion dpctl/tests/test_tensor_asarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_asarray_from_numpy():
assert type(Y) is dpt.usm_ndarray
assert Y.shape == Xnp.shape
assert Y.dtype == Xnp.dtype
# Fortan contiguous case
# Fortran contiguous case
Xnp = np.array([[1, 2, 3], [4, 5, 6]], dtype="f4", order="F")
Y = dpt.asarray(Xnp, usm_type="shared")
assert type(Y) is dpt.usm_ndarray
Expand Down
6 changes: 3 additions & 3 deletions libsyclinterface/include/dpctl_data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ typedef signed int ssize_t;
#endif /* _MSC_VER */

/*!
@brief Represents tha largest possible value of a 64 bit signed integer.
@brief Represents the largest possible value of a 64 bit signed integer.
*/
#if !defined(INT64_MAX)
#define INT64_MAX 9223372036854775807LL
#endif

/*!
@brief Represents tha smallest possible value of a 64 bit signed integer.
@brief Represents the smallest possible value of a 64 bit signed integer.
*/
#if !defined(INT64_MIN)
#define INT64_MIN ((-INT64_MAX) - 1)
#endif

/*!
@brief Represents tha largest possible value of a 64bit unsigned integer.
@brief Represents the largest possible value of a 64bit unsigned integer.
*/
#if !defined(UINT64_MAX)
#define UINT64_MAX 0xffffffffffffffffULL
Expand Down
3 changes: 2 additions & 1 deletion libsyclinterface/include/dpctl_device_selection.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//===-- dpctl_device_selection.h - Device selector class declar. --*-C++-*- =//
//===-- dpctl_device_selection.h -
// Device selector class declaration --*-C++-*- =//
//
//
// Data Parallel Control (dpctl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//===----------------------------------------------------------------------===//
///
/// \file
/// This header declares C contructors for the various SYCL device_selector
/// This header declares C constructors for the various SYCL device_selector
/// classes.
///
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/include/dpctl_sycl_event_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ DPCTL_C_EXTERN_C_BEGIN
DPCTL_DECLARE_VECTOR(Event)

/*!
* @brief A wrapper for ``sycl::event`` contructor to construct a new event.
* @brief A wrapper for ``sycl::event`` constructor to construct a new event.
*
* @return An opaque DPCTLSyclEventRef pointer wrapping a ``sycl::event``.
* @ingroup EventInterface
Expand Down
8 changes: 4 additions & 4 deletions libsyclinterface/include/dpctl_sycl_queue_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ DPCTL_C_EXTERN_C_BEGIN
*/

/*!
* @brief A wrapper for sycl::queue contructor to construct a new queue from the
* provided context, device, async handler and propertis bit flags.
* @brief A wrapper for sycl::queue constructor to construct a new queue from
* the provided context, device, async handler and propertis bit flags.
*
* @param CRef An opaque pointer to a sycl::context.
* @param DRef An opaque pointer to a sycl::device
Expand Down Expand Up @@ -362,7 +362,7 @@ DPCTL_API
size_t DPCTLQueue_Hash(__dpctl_keep const DPCTLSyclQueueRef QRef);

/*!
* @brief C-API wraper for ``sycl::queue::submit_barrier()``.
* @brief C-API wrapper for ``sycl::queue::submit_barrier()``.
*
* @param QRef An opaque pointer to the ``sycl::queue``.
* @return An opaque pointer to the ``sycl::event`` returned by the
Expand All @@ -373,7 +373,7 @@ __dpctl_give DPCTLSyclEventRef
DPCTLQueue_SubmitBarrier(__dpctl_keep const DPCTLSyclQueueRef QRef);

/*!
* @brief C-API wraper for ``sycl::queue::submit_barrier(event_vector)``.
* @brief C-API wrapper for ``sycl::queue::submit_barrier(event_vector)``.
*
* @param QRef An opaque pointer to the ``sycl::queue``.
* @param DepEvents List of dependent DPCTLSyclEventRef objects (events)
Expand Down
Loading