Skip to content

Commit 0512214

Browse files
Merge pull request #1386 from IntelPython/spelling-fixes
2 parents 8ccbee1 + 2f36893 commit 0512214

30 files changed

+51
-50
lines changed

dpctl/_sycl_context.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ cdef class SyclContext(_SyclContext):
114114
ctx = dpctl.SyclContext()
115115
print(ctx.get_devices())
116116
117-
- Invoking the constuctor with a specific filter string that creates a
117+
- Invoking the constructor with a specific filter string that creates a
118118
context for the device corresponding to the filter string.
119119
120120
:Example:
@@ -127,7 +127,7 @@ cdef class SyclContext(_SyclContext):
127127
d = ctx.get_devices()[0]
128128
assert(d.is_gpu)
129129
130-
- Invoking the constuctor with a :class:`dpctl.SyclDevice` object
130+
- Invoking the constructor with a :class:`dpctl.SyclDevice` object
131131
creates a context for that device.
132132
133133
:Example:
@@ -141,7 +141,7 @@ cdef class SyclContext(_SyclContext):
141141
d = ctx.get_devices()[0]
142142
assert(d.is_gpu)
143143
144-
- Invoking the constuctor with a list of :class:`dpctl.SyclDevice`
144+
- Invoking the constructor with a list of :class:`dpctl.SyclDevice`
145145
objects creates a common context for all the devices. This
146146
constructor call is especially useful when creation a context for
147147
multiple sub-devices.
@@ -159,7 +159,7 @@ cdef class SyclContext(_SyclContext):
159159
ctx = dpctl.SyclContext(sub_devices)
160160
assert(len(ctx.get_devices) == len(sub_devices))
161161
162-
- Invoking the constuctor with a named ``PyCapsule`` with name
162+
- Invoking the constructor with a named ``PyCapsule`` with name
163163
**"SyclContextRef"** that carries a pointer to a ``sycl::context``
164164
object. The capsule will be renamed upon successful consumption
165165
to ensure one-time use. A new named capsule can be constructed by
@@ -430,7 +430,7 @@ cdef class SyclContext(_SyclContext):
430430
return num_devs
431431
else:
432432
raise ValueError(
433-
"An error was encountered quering the number of devices "
433+
"An error was encountered querying the number of devices "
434434
"associated with this context"
435435
)
436436

dpctl/_sycl_device.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ cdef class SyclDevice(_SyclDevice):
11631163
def create_sub_devices(self, **kwargs):
11641164
"""create_sub_devices(partition=parition_spec)
11651165
Creates a list of sub-devices by partitioning a root device based on the
1166-
provided partion specifier.
1166+
provided partition specifier.
11671167
11681168
A partition specifier must be provided using a "partition"
11691169
keyword argument. Possible values for the specifier are: an int, a

dpctl/_sycl_event.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ cdef class SyclEvent(_SyclEvent):
119119
# Create a default SyclEvent
120120
e = dpctl.SyclEvent()
121121
122-
- Invoking the constuctor with a named ``PyCapsule`` with name
122+
- Invoking the constructor with a named ``PyCapsule`` with name
123123
**"SyclEventRef"** that carries a pointer to a ``sycl::event``
124124
object. The capsule will be renamed upon successful consumption
125125
to ensure one-time use. A new named capsule can be constructed by

dpctl/_sycl_queue.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ cdef class SyclQueue(_SyclQueue):
246246
# create a queue for each sub-device using the common context
247247
queues = [dpctl.SyclQueue(ctx, sub_d) for sub_d in sub_devices]
248248
249-
- Invoking the constuctor with a named ``PyCapsule`` with the name
249+
- Invoking the constructor with a named ``PyCapsule`` with the name
250250
**"SyclQueueRef"** that carries a pointer to a ``sycl::queue``
251251
object. The capsule will be renamed upon successful consumption
252252
to ensure one-time use. A new named capsule can be constructed by

dpctl/_sycl_timer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class SyclTimer:
3737
q = dpctl.SyclQueue(property='enable_profiling')
3838
3939
# create the timer
40-
miliseconds_sc = 1e-3
41-
timer = dpctl.SyclTimer(time_scale = miliseconds_sc)
40+
milliseconds_sc = 1e-3
41+
timer = dpctl.SyclTimer(time_scale = milliseconds_sc)
4242
4343
# use the timer
4444
with timer(queue=q):
4545
code_block
4646
47-
# retrieve elapsed times in miliseconds
47+
# retrieve elapsed times in milliseconds
4848
sycl_dt, wall_dt = timer.dt
4949
5050
Remark:

dpctl/apis/include/dpctl4pybind11.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,12 @@ class usm_memory : public py::object
742742
return nullptr;
743743
}
744744

745-
auto convertor =
745+
auto converter =
746746
::dpctl::detail::dpctl_capi::get().as_usm_memory_pyobj();
747747

748748
py::object res;
749749
try {
750-
res = convertor(py::handle(o));
750+
res = converter(py::handle(o));
751751
} catch (const py::error_already_set &e) {
752752
return nullptr;
753753
}

dpctl/memory/_memory.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ cdef void copy_via_host(void *dest_ptr, SyclQueue dest_queue,
9292
void *src_ptr, SyclQueue src_queue, size_t nbytes):
9393
"""
9494
Copies `nbytes` bytes from `src_ptr` USM memory to
95-
`dest_ptr` USM memory using host as the intemediary.
95+
`dest_ptr` USM memory using host as the intermediary.
9696
9797
This is useful when `src_ptr` and `dest_ptr` are bound to incompatible
9898
SYCL contexts.

dpctl/tensor/_copy_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _copy_to_numpy(ary):
5656

5757
def _copy_from_numpy(np_ary, usm_type="device", sycl_queue=None):
5858
"Copies numpy array `np_ary` into a new usm_ndarray"
59-
# This may peform a copy to meet stated requirements
59+
# This may perform a copy to meet stated requirements
6060
Xnp = np.require(np_ary, requirements=["A", "E"])
6161
alloc_q = normalize_queue_device(sycl_queue=sycl_queue, device=None)
6262
dt = Xnp.dtype

dpctl/tensor/_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def sycl_context(self):
9696
@property
9797
def sycl_device(self):
9898
"""
99-
:class:`dpctl.SyclDevice` targed by this :class:`.Device`.
99+
:class:`dpctl.SyclDevice` targeted by this :class:`.Device`.
100100
"""
101101
return self.sycl_queue_.sycl_device
102102

dpctl/tensor/_elementwise_funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@
16281628
_subtract_docstring_ = """
16291629
subtract(x1, x2, out=None, order='K')
16301630
1631-
Calculates the difference bewteen each element `x1_i` of the input
1631+
Calculates the difference between each element `x1_i` of the input
16321632
array `x1` and the respective element `x2_i` of the input array `x2`.
16331633
16341634
Args:

dpctl/tensor/_manipulation_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def broadcast_to(X, shape):
315315
raise TypeError(f"Expected usm_ndarray type, got {type(X)}.")
316316

317317
# Use numpy.broadcast_to to check the validity of the input
318-
# parametr 'shape'. Raise ValueError if 'X' is not compatible
318+
# parameter 'shape'. Raise ValueError if 'X' is not compatible
319319
# with 'shape' according to NumPy's broadcasting rules.
320320
new_array = np.broadcast_to(
321321
np.broadcast_to(np.empty(tuple(), dtype="u1"), X.shape), shape
@@ -757,7 +757,7 @@ def iinfo(dtype):
757757
758758
Returns:
759759
iinfo_object:
760-
An object with the followign attributes
760+
An object with the following attributes
761761
* bits: int
762762
number of bits occupied by the data type
763763
* max: int

dpctl/tensor/_print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def set_print_options(
148148
suppress (bool, optional): If `True,` numbers equal to zero
149149
in the current precision will print as zero.
150150
Default: `False`.
151-
nanstr (str, optional): String used to repesent nan.
151+
nanstr (str, optional): String used to represent nan.
152152
Raises `TypeError` if nanstr is not a string.
153153
Default: `"nan"`.
154154
infstr (str, optional): String used to represent infinity.

dpctl/tensor/_slicing.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _basic_slice_meta(ind, shape : tuple, strides : tuple, offset : int):
104104
Give basic slicing index `ind` and array layout information produce
105105
a 5-tuple (resulting_shape, resulting_strides, resulting_offset,
106106
advanced_ind, resulting_advanced_ind_pos)
107-
used to contruct a view into underlying array over which advanced
107+
used to construct a view into underlying array over which advanced
108108
indexing, if any, is to be performed.
109109
110110
Raises IndexError for invalid index `ind`.
@@ -201,7 +201,7 @@ def _basic_slice_meta(ind, shape : tuple, strides : tuple, offset : int):
201201
raise TypeError
202202
if ellipses_count > 1:
203203
raise IndexError(
204-
"an index can only have a sinlge ellipsis ('...')")
204+
"an index can only have a single ellipsis ('...')")
205205
if axes_referenced > len(shape):
206206
raise IndexError(
207207
"too many indices for an array, array is "

dpctl/tensor/_stride_utils.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ cdef int _from_input_shape_strides(
5555
nelems - Number of elements in array
5656
min_disp = min( dot(strides, index), index for shape)
5757
max_disp = max( dor(strides, index), index for shape)
58-
contig = enumation for array contiguity
58+
contig = enumeration for array contiguity
5959
Returns: 0 on success, error code otherwise.
6060
On success pointers point to allocated arrays,
6161
Otherwise they are set to NULL

dpctl/tensor/_usmarray.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ cdef class usm_ndarray:
425425
cdef char *ary_ptr = NULL
426426
if (not isinstance(self.base_, dpmem._memory._Memory)):
427427
raise InternalUSMArrayError(
428-
"Invalid instance of usm_ndarray ecountered. "
428+
"Invalid instance of usm_ndarray encountered. "
429429
"Private field base_ has an unexpected type {}.".format(
430430
type(self.base_)
431431
)
@@ -566,7 +566,7 @@ cdef class usm_ndarray:
566566
elif (self.flags_ & USM_ARRAY_F_CONTIGUOUS):
567567
return _f_contig_strides(self.nd_, self.shape_)
568568
else:
569-
raise ValueError("Inconsitent usm_ndarray data")
569+
raise ValueError("Inconsistent usm_ndarray data")
570570

571571
@property
572572
def flags(self):
@@ -653,7 +653,7 @@ cdef class usm_ndarray:
653653

654654
@property
655655
def T(self):
656-
""" Returns tranposed array for 2D array, raises `ValueError`
656+
""" Returns transposed array for 2D array, raises `ValueError`
657657
otherwise.
658658
"""
659659
if self.nd_ == 2:
@@ -1376,8 +1376,8 @@ cdef api object UsmNDArray_MakeSimpleFromMemory(
13761376
QRef: DPCTLSyclQueueRef associated with the allocation
13771377
offset: distance between element with zero multi-index and the
13781378
start of allocation
1379-
oder: Memory layout of the array. Use 'C' for C-contiguous or
1380-
row-major layout; 'F' for F-contiguous or column-major layout
1379+
order: Memory layout of the array. Use 'C' for C-contiguous or
1380+
row-major layout; 'F' for F-contiguous or column-major layout
13811381
Returns:
13821382
Created usm_ndarray instance
13831383
"""

dpctl/tensor/include/dlpack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ The header `dlpack.h` downloaded from `https://github.com/dmlc/dlpack.git` remot
44

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

7-
License file was retrived from https://github.com/dmlc/dlpack/blob/main/LICENSE
7+
License file was retrieved from https://github.com/dmlc/dlpack/blob/main/LICENSE

dpctl/tensor/include/dlpack/dlpack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ typedef struct {
168168
* `byte_offset` field should be used to point to the beginning of the data.
169169
*
170170
* Note that as of Nov 2021, multiply libraries (CuPy, PyTorch, TensorFlow,
171-
* TVM, perhaps others) do not adhere to this 256 byte aligment requirement
171+
* TVM, perhaps others) do not adhere to this 256 byte alignment requirement
172172
* on CPU/CUDA/ROCm, and always use `byte_offset=0`. This must be fixed
173173
* (after which this note will be updated); at the moment it is recommended
174174
* to not rely on the data pointer being correctly aligned.

dpctl/tensor/libtensor/include/kernels/copy_and_cast.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ typedef sycl::event (*copy_and_cast_generic_fn_ptr_t)(
118118
* @brief Generic function to copy `nelems` elements from `src` usm_ndarray to
119119
`dst` usm_ndarray while casting from `srcTy` to `dstTy`.
120120
121-
Both arrays have array dimensionality specied via argument `nd`. The
121+
Both arrays have array dimensionality specified via argument `nd`. The
122122
`shape_and_strides` is kernel accessible USM array of length `3*nd`, where the
123123
first `nd` elements encode common shape, second `nd` elements contain strides
124124
of `src` array, and the trailing `nd` elements contain strides of `dst` array.
@@ -696,7 +696,7 @@ typedef sycl::event (*copy_for_reshape_fn_ptr_t)(
696696
* @param src_nd Array dimension of the source array
697697
* @param dst_nd Array dimension of the destination array
698698
* @param packed_shapes_and_strides Kernel accessible USM array of size
699-
* `2*src_nd + 2*dst_nd` with contant `[src_shape, src_strides, dst_shape,
699+
* `2*src_nd + 2*dst_nd` with content `[src_shape, src_strides, dst_shape,
700700
* dst_strides]`.
701701
* @param src_p Typeless USM pointer to the buffer of the source array
702702
* @param dst_p Typeless USM pointer to the buffer of the destination array

dpctl/tensor/libtensor/include/kernels/reductions.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ sycl::event sum_reduction_over_group_temps_strided_impl(
642642

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

dpctl/tensor/libtensor/include/utils/offset_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ device_allocate_and_pack(sycl::queue q,
9191
{
9292

9393
// memory transfer optimization, use USM-host for temporary speeds up
94-
// tranfer to device, especially on dGPUs
94+
// transfer to device, especially on dGPUs
9595
using usm_host_allocatorT =
9696
sycl::usm_allocator<indT, sycl::usm::alloc::host>;
9797
using shT = std::vector<indT, usm_host_allocatorT>;

dpctl/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void copy_numpy_ndarray_into_usm_ndarray(
210210
simplified_dst_strides.push_back(1);
211211
}
212212

213-
// Minumum and maximum element offsets for source np.ndarray
213+
// Minimum and maximum element offsets for source np.ndarray
214214
py::ssize_t npy_src_min_nelem_offset(src_offset);
215215
py::ssize_t npy_src_max_nelem_offset(src_offset);
216216
for (int i = 0; i < nd; ++i) {

dpctl/tensor/libtensor/source/device_support_queries.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ std::string _default_device_fp_type(sycl::device d)
5151

5252
std::string _default_device_int_type(sycl::device)
5353
{
54-
return "l"; // code for numpy.dtype('long') to be consisent
54+
return "l"; // code for numpy.dtype('long') to be consistent
5555
// with NumPy's default integer type across
5656
// platforms.
5757
}

dpctl/tensor/libtensor/source/tensor_py.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ PYBIND11_MODULE(_tensor_impl, m)
245245

246246
m.def("_copy_numpy_ndarray_into_usm_ndarray",
247247
&copy_numpy_ndarray_into_usm_ndarray,
248-
"Copy fom numpy array `src` into usm_ndarray `dst` synchronously.",
248+
"Copy from numpy array `src` into usm_ndarray `dst` synchronously.",
249249
py::arg("src"), py::arg("dst"), py::arg("sycl_queue"),
250250
py::arg("depends") = py::list());
251251

dpctl/tests/test_tensor_asarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_asarray_from_numpy():
7171
assert type(Y) is dpt.usm_ndarray
7272
assert Y.shape == Xnp.shape
7373
assert Y.dtype == Xnp.dtype
74-
# Fortan contiguous case
74+
# Fortran contiguous case
7575
Xnp = np.array([[1, 2, 3], [4, 5, 6]], dtype="f4", order="F")
7676
Y = dpt.asarray(Xnp, usm_type="shared")
7777
assert type(Y) is dpt.usm_ndarray

libsyclinterface/include/dpctl_data_types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ typedef signed int ssize_t;
8181
#endif /* _MSC_VER */
8282

8383
/*!
84-
@brief Represents tha largest possible value of a 64 bit signed integer.
84+
@brief Represents the largest possible value of a 64 bit signed integer.
8585
*/
8686
#if !defined(INT64_MAX)
8787
#define INT64_MAX 9223372036854775807LL
8888
#endif
8989

9090
/*!
91-
@brief Represents tha smallest possible value of a 64 bit signed integer.
91+
@brief Represents the smallest possible value of a 64 bit signed integer.
9292
*/
9393
#if !defined(INT64_MIN)
9494
#define INT64_MIN ((-INT64_MAX) - 1)
9595
#endif
9696

9797
/*!
98-
@brief Represents tha largest possible value of a 64bit unsigned integer.
98+
@brief Represents the largest possible value of a 64bit unsigned integer.
9999
*/
100100
#if !defined(UINT64_MAX)
101101
#define UINT64_MAX 0xffffffffffffffffULL

libsyclinterface/include/dpctl_device_selection.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//===-- dpctl_device_selection.h - Device selector class declar. --*-C++-*- =//
1+
//===-- dpctl_device_selection.h -
2+
// Device selector class declaration --*-C++-*- =//
23
//
34
//
45
// Data Parallel Control (dpctl)

libsyclinterface/include/dpctl_sycl_device_selector_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020
///
2121
/// \file
22-
/// This header declares C contructors for the various SYCL device_selector
22+
/// This header declares C constructors for the various SYCL device_selector
2323
/// classes.
2424
///
2525
//===----------------------------------------------------------------------===//

libsyclinterface/include/dpctl_sycl_event_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DPCTL_C_EXTERN_C_BEGIN
4444
DPCTL_DECLARE_VECTOR(Event)
4545

4646
/*!
47-
* @brief A wrapper for ``sycl::event`` contructor to construct a new event.
47+
* @brief A wrapper for ``sycl::event`` constructor to construct a new event.
4848
*
4949
* @return An opaque DPCTLSyclEventRef pointer wrapping a ``sycl::event``.
5050
* @ingroup EventInterface

libsyclinterface/include/dpctl_sycl_queue_interface.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ DPCTL_C_EXTERN_C_BEGIN
4242
*/
4343

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

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

375375
/*!
376-
* @brief C-API wraper for ``sycl::queue::submit_barrier(event_vector)``.
376+
* @brief C-API wrapper for ``sycl::queue::submit_barrier(event_vector)``.
377377
*
378378
* @param QRef An opaque pointer to the ``sycl::queue``.
379379
* @param DepEvents List of dependent DPCTLSyclEventRef objects (events)

0 commit comments

Comments
 (0)