Skip to content

Commit 91fd41f

Browse files
Apply review comments
1 parent 9130a53 commit 91fd41f

15 files changed

+40
-98
lines changed

dpnp/backend/extensions/statistics/bincount.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232

3333
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
3434

35-
namespace statistics
36-
{
37-
namespace histogram
35+
namespace statistics::histogram
3836
{
3937
struct Bincount
4038
{
@@ -62,5 +60,4 @@ struct Bincount
6260
};
6361

6462
void populate_bincount(py::module_ m);
65-
} // namespace histogram
66-
} // namespace statistics
63+
} // namespace statistics::histogram

dpnp/backend/extensions/statistics/common.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@
2929

3030
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
3131

32-
namespace statistics
32+
namespace statistics::common
3333
{
34-
namespace common
35-
{
36-
3734
size_t get_max_local_size(const sycl::device &device)
3835
{
3936
constexpr const int default_max_cpu_local_size = 256;
@@ -120,5 +117,4 @@ pybind11::dtype dtype_from_typenum(int dst_typenum)
120117
}
121118
}
122119

123-
} // namespace common
124-
} // namespace statistics
120+
} // namespace statistics::common

dpnp/backend/extensions/statistics/common.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
#include "utils/math_utils.hpp"
3737
// clang-format on
3838

39-
namespace statistics
40-
{
41-
namespace common
39+
namespace statistics::common
4240
{
4341

4442
template <typename N, typename D>
@@ -200,5 +198,4 @@ sycl::nd_range<1>
200198
// headers of dpctl.
201199
pybind11::dtype dtype_from_typenum(int dst_typenum);
202200

203-
} // namespace common
204-
} // namespace statistics
201+
} // namespace statistics::common

dpnp/backend/extensions/statistics/dispatch_table.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,8 @@
3939
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
4040
namespace py = pybind11;
4141

42-
namespace statistics
42+
namespace statistics::common
4343
{
44-
namespace common
45-
{
46-
4744
template <typename T, typename Rest>
4845
struct one_of
4946
{
@@ -386,5 +383,4 @@ class DispatchTable2
386383
Table2<FnT> table;
387384
};
388385

389-
} // namespace common
390-
} // namespace statistics
386+
} // namespace statistics::common

dpnp/backend/extensions/statistics/histogram.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
#include <algorithm>
2727
#include <complex>
2828
#include <memory>
29-
#include <string>
30-
#include <type_traits>
31-
#include <unordered_map>
29+
#include <tuple>
3230
#include <vector>
3331

3432
#include <pybind11/pybind11.h>

dpnp/backend/extensions/statistics/histogram.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929

3030
#include "dispatch_table.hpp"
3131

32-
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
32+
// namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
3333

34-
namespace statistics
35-
{
36-
namespace histogram
34+
namespace statistics::histogram
3735
{
3836
struct Histogram
3937
{
@@ -59,5 +57,4 @@ struct Histogram
5957
};
6058

6159
void populate_histogram(py::module_ m);
62-
} // namespace histogram
63-
} // namespace statistics
60+
} // namespace statistics::histogram

dpnp/backend/extensions/statistics/histogram_common.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@
2626
#include <algorithm>
2727
#include <limits>
2828
#include <string>
29-
#include <unordered_map>
3029
#include <vector>
3130

3231
#include "dpctl4pybind11.hpp"
33-
#include "utils/memory_overlap.hpp"
34-
#include "utils/output_validation.hpp"
3532
#include "utils/type_dispatch.hpp"
3633

3734
#include <pybind11/pybind11.h>

dpnp/backend/extensions/statistics/histogram_common.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@
2929

3030
#include "common.hpp"
3131

32-
namespace dpctl
33-
{
34-
namespace tensor
35-
{
36-
class usm_ndarray;
37-
}
38-
} // namespace dpctl
39-
4032
using dpctl::tensor::usm_ndarray;
4133

4234
namespace statistics

dpnp/backend/extensions/statistics/sliding_dot_product1d.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@
2323
// THE POSSIBILITY OF SUCH DAMAGE.
2424
//*****************************************************************************
2525

26-
#include <algorithm>
2726
#include <complex>
2827
#include <memory>
29-
#include <string>
30-
#include <type_traits>
31-
#include <unordered_map>
3228
#include <vector>
3329

3430
#include <pybind11/pybind11.h>
@@ -42,7 +38,7 @@
4238
#include "sliding_dot_product1d.hpp"
4339
#include "sliding_window1d.hpp"
4440

45-
#include <iostream>
41+
// #include <iostream>
4642

4743
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
4844
using dpctl::tensor::usm_ndarray;
@@ -101,7 +97,9 @@ struct SlidingDotProductF
10197
}
10298
};
10399

104-
using SupportedTypes = std::tuple<uint64_t,
100+
using SupportedTypes = std::tuple<uint32_t,
101+
int32_t,
102+
uint64_t,
105103
int64_t,
106104
float,
107105
double,

dpnp/backend/extensions/statistics/sliding_dot_product1d.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@
2626
#pragma once
2727

2828
#include "dispatch_table.hpp"
29-
#include "utils/type_dispatch.hpp"
3029
#include <pybind11/pybind11.h>
3130
#include <sycl/sycl.hpp>
3231

33-
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
34-
35-
namespace statistics
36-
{
37-
namespace sliding_window1d
32+
namespace statistics::sliding_window1d
3833
{
3934
struct SlidingDotProduct1d
4035
{
@@ -62,5 +57,4 @@ struct SlidingDotProduct1d
6257
};
6358

6459
void populate_sliding_dot_product1d(py::module_ m);
65-
} // namespace sliding_window1d
66-
} // namespace statistics
60+
} // namespace statistics::sliding_window1d

0 commit comments

Comments
 (0)