Skip to content

Commit 387c06f

Browse files
Replace dpctl.tensor with dpnp.tensor in dpnp.tensor
1 parent 7d5f244 commit 387c06f

247 files changed

Lines changed: 339 additions & 320 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dpnp/tensor/_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Device:
4040
4141
This is a wrapper around :class:`dpctl.SyclQueue` with custom
4242
formatting. The class does not have public constructor,
43-
but a class method :meth:`dpctl.tensor.Device.create_device` to construct
43+
but a class method :meth:`dpnp.tensor.Device.create_device` to construct
4444
it from `device` keyword argument in Array-API functions.
4545
4646
Instance can be queried for ``sycl_queue``, ``sycl_context``,

dpnp/tensor/libtensor/include/kernels/clip.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===---------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines kernels for dpctl.tensor.clip.
32+
/// This file defines kernels for dpnp.tensor.clip.
3333
//===---------------------------------------------------------------------===//
3434

3535
#pragma once
@@ -73,7 +73,8 @@ T clip(const T &x, const T &min, const T &max)
7373
return min_complex(max_complex(x, min), max);
7474
}
7575
else if constexpr (std::is_floating_point_v<T> ||
76-
std::is_same_v<T, sycl::half>) {
76+
std::is_same_v<T, sycl::half>)
77+
{
7778
auto tmp = (std::isnan(x) || x > min) ? x : min;
7879
return (std::isnan(tmp) || tmp < max) ? tmp : max;
7980
}

dpnp/tensor/libtensor/include/kernels/dpctl_tensor_types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//*****************************************************************************
2828
///
2929
/// \file
30-
/// This file defines functions of dpctl.tensor._tensor_impl extensions
30+
/// This file defines functions of dpnp.tensor._tensor_impl extensions
3131
//===--------------------------------------------------------------------===//
3232

3333
#pragma once

dpnp/tensor/libtensor/include/kernels/sorting/radix_sort.hpp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===----------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines functions of dpctl.tensor._tensor_sorting_impl
32+
/// This file defines functions of dpnp.tensor._tensor_sorting_impl
3333
/// extension.
3434
//===----------------------------------------------------------------------===//
3535

@@ -340,7 +340,8 @@ sycl::event
340340
sycl::min(seg_start + elems_per_segment, n);
341341
if (is_ascending) {
342342
for (std::size_t val_id = seg_start + lid; val_id < seg_end;
343-
val_id += wg_size) {
343+
val_id += wg_size)
344+
{
344345
// get the bucket for the bit-ordered input value,
345346
// applying the offset and mask for radix bits
346347
const auto val =
@@ -355,7 +356,8 @@ sycl::event
355356
}
356357
else {
357358
for (std::size_t val_id = seg_start + lid; val_id < seg_end;
358-
val_id += wg_size) {
359+
val_id += wg_size)
360+
{
359361
// get the bucket for the bit-ordered input value,
360362
// applying the offset and mask for radix bits
361363
const auto val =
@@ -691,7 +693,8 @@ void copy_func_for_radix_sort(const std::size_t n_segments,
691693
// find offsets for the same values within a segment and fill the resulting
692694
// buffer
693695
for (std::size_t val_id = seg_start + lid; val_id < seg_end;
694-
val_id += sg_size) {
696+
val_id += sg_size)
697+
{
695698
output_ptr[val_id] = std::move(input_ptr[val_id]);
696699
}
697700

@@ -822,7 +825,8 @@ sycl::event
822825
// resulting buffer
823826
if (is_ascending) {
824827
for (std::size_t val_id = seg_start + lid; val_id < seg_end;
825-
val_id += sg_size) {
828+
val_id += sg_size)
829+
{
826830
ValueT in_val = std::move(b_input_ptr[val_id]);
827831

828832
// get the bucket for the bit-ordered input value, applying
@@ -851,7 +855,8 @@ sycl::event
851855
}
852856
else {
853857
for (std::size_t val_id = seg_start + lid; val_id < seg_end;
854-
val_id += sg_size) {
858+
val_id += sg_size)
859+
{
855860
ValueT in_val = std::move(b_input_ptr[val_id]);
856861

857862
// get the bucket for the bit-ordered input value, applying
@@ -1164,10 +1169,7 @@ struct subgroup_radix_sort
11641169
return sycl::local_accessor<KeyT>(buf_size, cgh);
11651170
}
11661171

1167-
std::size_t get_iter_stride() const
1168-
{
1169-
return std::size_t{0};
1170-
}
1172+
std::size_t get_iter_stride() const { return std::size_t{0}; }
11711173
};
11721174

11731175
template <typename KeyT>
@@ -1185,10 +1187,7 @@ struct subgroup_radix_sort
11851187
{
11861188
return sycl::accessor(buf, cgh, sycl::read_write, sycl::no_init);
11871189
}
1188-
std::size_t get_iter_stride() const
1189-
{
1190-
return iter_stride;
1191-
}
1190+
std::size_t get_iter_stride() const { return iter_stride; }
11921191
};
11931192

11941193
static_assert(wg_size <= 1024);
@@ -1377,7 +1376,8 @@ struct subgroup_radix_sort
13771376
if (is_ascending) {
13781377
#pragma unroll
13791378
for (std::uint16_t i = 0; i < block_size;
1380-
++i) {
1379+
++i)
1380+
{
13811381
const std::uint16_t id =
13821382
wi * block_size + i;
13831383
static constexpr std::uint16_t
@@ -1413,7 +1413,8 @@ struct subgroup_radix_sort
14131413
else {
14141414
#pragma unroll
14151415
for (std::uint16_t i = 0; i < block_size;
1416-
++i) {
1416+
++i)
1417+
{
14171418
const std::uint16_t id =
14181419
wi * block_size + i;
14191420
static constexpr std::uint16_t
@@ -1740,7 +1741,8 @@ sycl::event parallel_radix_sort_impl(sycl::queue &exec_q,
17401741
depends);
17411742

17421743
for (std::uint32_t radix_iter = 1; radix_iter < radix_iters;
1743-
++radix_iter) {
1744+
++radix_iter)
1745+
{
17441746
if (radix_iter % 2 == 0) {
17451747
sort_ev = parallel_radix_sort_iteration_step<
17461748
radix_bits,
@@ -1798,10 +1800,7 @@ struct IndexedProj
17981800
{
17991801
}
18001802

1801-
auto operator()(IndexT i) const
1802-
{
1803-
return value_projector(ptr[i]);
1804-
}
1803+
auto operator()(IndexT i) const { return value_projector(ptr[i]); }
18051804

18061805
private:
18071806
const ValueT *ptr;

dpnp/tensor/libtensor/include/kernels/sorting/sort_impl_fn_ptr_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===----------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines functions of dpctl.tensor._tensor_sorting_impl
32+
/// This file defines functions of dpnp.tensor._tensor_sorting_impl
3333
/// extension.
3434
//===----------------------------------------------------------------------===//
3535

dpnp/tensor/libtensor/include/kernels/where.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===---------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines kernels for dpctl.tensor.where.
32+
/// This file defines kernels for dpnp.tensor.where.
3333
//===---------------------------------------------------------------------===//
3434

3535
#pragma once

dpnp/tensor/libtensor/include/utils/rich_comparisons.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//*****************************************************************************
2828
///
2929
/// \file
30-
/// This file defines functions of dpctl.tensor._tensor_sorting_impl
30+
/// This file defines functions of dpnp.tensor._tensor_sorting_impl
3131
/// extension.
3232
//===---------------------------------------------------------------------===//
3333

@@ -112,9 +112,9 @@ struct ExtendedComplexFPGreater
112112
};
113113

114114
template <typename T>
115-
inline constexpr bool is_fp_v = (std::is_same_v<T, sycl::half> ||
116-
std::is_same_v<T, float> ||
117-
std::is_same_v<T, double>);
115+
inline constexpr bool is_fp_v =
116+
(std::is_same_v<T, sycl::half> || std::is_same_v<T, float> ||
117+
std::is_same_v<T, double>);
118118

119119
} // namespace detail
120120

dpnp/tensor/libtensor/source/accumulators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===----------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines functions of dpctl.tensor._tensor_impl extensions
32+
/// This file defines functions of dpnp.tensor._tensor_impl extensions
3333
//===----------------------------------------------------------------------===//
3434

3535
#include <cstddef>

dpnp/tensor/libtensor/source/accumulators.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===----------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines functions of dpctl.tensor._tensor_impl extensions
32+
/// This file defines functions of dpnp.tensor._tensor_impl extensions
3333
//===----------------------------------------------------------------------===//
3434

3535
#pragma once

dpnp/tensor/libtensor/source/accumulators/accumulate_over_axis.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//===----------------------------------------------------------------------===//
3030
///
3131
/// \file
32-
/// This file defines functions of dpctl.tensor._tensor_accumulation_impl
32+
/// This file defines functions of dpnp.tensor._tensor_accumulation_impl
3333
// extensions
3434
//===----------------------------------------------------------------------===//
3535

0 commit comments

Comments
 (0)