Skip to content

Commit 4bf080e

Browse files
Apply remarks for c++ files
1 parent 79cb2a4 commit 4bf080e

11 files changed

+43
-111
lines changed

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,20 @@
3333
//===----------------------------------------------------------------------===//
3434

3535
#pragma once
36-
#include <complex>
36+
#include <algorithm>
37+
#include <array>
3738
#include <cstddef>
3839
#include <cstdint>
3940
#include <sycl/sycl.hpp>
40-
#include <type_traits>
41+
#include <vector>
4142

4243
#include "dpctl_tensor_types.hpp"
4344
#include "kernels/alignment.hpp"
4445
#include "utils/offset_utils.hpp"
4546
#include "utils/sycl_utils.hpp"
4647
#include "utils/type_utils.hpp"
4748

48-
namespace dpctl
49-
{
50-
namespace tensor
51-
{
52-
namespace kernels
53-
{
54-
namespace copy_and_cast
49+
namespace dpctl::tensor::kernels::copy_and_cast
5550
{
5651

5752
using dpctl::tensor::ssize_t;
@@ -1282,7 +1277,4 @@ struct CopyForRollNDShiftFactory
12821277
}
12831278
};
12841279

1285-
} // namespace copy_and_cast
1286-
} // namespace kernels
1287-
} // namespace tensor
1288-
} // namespace dpctl
1280+
} // namespace dpctl::tensor::kernels::copy_and_cast

dpctl_ext/tensor/libtensor/include/kernels/copy_as_contiguous.hpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,20 @@
3333
//===----------------------------------------------------------------------===//
3434

3535
#pragma once
36-
#include <complex>
36+
#include <algorithm>
37+
#include <array>
3738
#include <cstddef>
3839
#include <cstdint>
3940
#include <sycl/sycl.hpp>
40-
#include <type_traits>
41+
#include <vector>
4142

4243
#include "dpctl_tensor_types.hpp"
4344
#include "kernels/alignment.hpp"
4445
#include "utils/offset_utils.hpp"
4546
#include "utils/sycl_utils.hpp"
4647
#include "utils/type_utils.hpp"
4748

48-
namespace dpctl
49-
{
50-
namespace tensor
51-
{
52-
namespace kernels
53-
{
54-
namespace copy_as_contig
49+
namespace dpctl::tensor::kernels::copy_as_contig
5550
{
5651

5752
using dpctl::tensor::ssize_t;
@@ -648,8 +643,4 @@ struct AsCContigNDBatchOfSquareMatricesFactory
648643
return as_c_contiguous_nd_batch_of_square_matrices_impl<T>;
649644
}
650645
};
651-
652-
} // namespace copy_as_contig
653-
} // namespace kernels
654-
} // namespace tensor
655-
} // namespace dpctl
646+
} // namespace dpctl::tensor::kernels::copy_as_contig

dpctl_ext/tensor/libtensor/source/copy_and_cast_usm_to_usm.cpp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,27 @@
3232
/// This file defines functions of dpctl.tensor._tensor_impl extensions
3333
//===----------------------------------------------------------------------===//
3434

35-
#include <algorithm>
36-
#include <complex>
35+
#include <array>
3736
#include <cstddef>
38-
#include <cstdint>
39-
#include <stdexcept>
4037
#include <sycl/sycl.hpp>
41-
#include <thread>
42-
#include <type_traits>
38+
#include <tuple>
4339
#include <utility>
40+
#include <vector>
4441

4542
#include "dpnp4pybind11.hpp"
46-
#include <pybind11/complex.h>
47-
#include <pybind11/numpy.h>
4843
#include <pybind11/pybind11.h>
49-
#include <pybind11/stl.h>
5044

5145
#include "kernels/copy_and_cast.hpp"
5246
#include "utils/memory_overlap.hpp"
5347
#include "utils/offset_utils.hpp"
5448
#include "utils/output_validation.hpp"
5549
#include "utils/sycl_alloc_utils.hpp"
5650
#include "utils/type_dispatch.hpp"
57-
#include "utils/type_utils.hpp"
5851

5952
#include "copy_as_contig.hpp"
6053
#include "simplify_iteration_space.hpp"
6154

62-
namespace dpctl
63-
{
64-
namespace tensor
65-
{
66-
namespace py_internal
55+
namespace dpctl::tensor::py_internal
6756
{
6857

6958
namespace td_ns = dpctl::tensor::type_dispatch;
@@ -305,6 +294,4 @@ void init_copy_and_cast_usm_to_usm_dispatch_tables(void)
305294
dtb_1d.populate_dispatch_table(copy_and_cast_1d_dispatch_table);
306295
}
307296

308-
} // namespace py_internal
309-
} // namespace tensor
310-
} // namespace dpctl
297+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/copy_and_cast_usm_to_usm.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@
3838
#include <vector>
3939

4040
#include "dpnp4pybind11.hpp"
41-
#include <pybind11/pybind11.h>
4241

43-
namespace dpctl
44-
{
45-
namespace tensor
46-
{
47-
namespace py_internal
42+
namespace dpctl::tensor::py_internal
4843
{
4944

5045
extern std::pair<sycl::event, sycl::event> copy_usm_ndarray_into_usm_ndarray(
@@ -55,6 +50,4 @@ extern std::pair<sycl::event, sycl::event> copy_usm_ndarray_into_usm_ndarray(
5550

5651
extern void init_copy_and_cast_usm_to_usm_dispatch_tables();
5752

58-
} // namespace py_internal
59-
} // namespace tensor
60-
} // namespace dpctl
53+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/copy_as_contig.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
/// This file defines functions of dpctl.tensor._tensor_impl extensions
3333
//===----------------------------------------------------------------------===//
3434

35-
#include <algorithm>
3635
#include <cstddef>
36+
#include <iterator>
3737
#include <numeric>
3838
#include <stdexcept>
39+
#include <tuple>
3940
#include <utility>
4041
#include <vector>
4142

@@ -54,13 +55,10 @@
5455
#include "copy_as_contig.hpp"
5556
#include "simplify_iteration_space.hpp"
5657

57-
namespace dpctl
58-
{
59-
namespace tensor
60-
{
61-
namespace py_internal
58+
namespace dpctl::tensor::py_internal
6259
{
6360

61+
namespace py = pybind11;
6462
namespace td_ns = dpctl::tensor::type_dispatch;
6563

6664
using dpctl::tensor::kernels::copy_as_contig::
@@ -753,6 +751,4 @@ std::pair<sycl::event, sycl::event>
753751
ascontig_ev);
754752
}
755753

756-
} // end of namespace py_internal
757-
} // end of namespace tensor
758-
} // end of namespace dpctl
754+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/copy_as_contig.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@
3232
#include <vector>
3333

3434
#include "dpnp4pybind11.hpp"
35-
#include <pybind11/pybind11.h>
3635
#include <sycl/sycl.hpp>
3736

38-
namespace dpctl
39-
{
40-
namespace tensor
41-
{
42-
namespace py_internal
37+
namespace dpctl::tensor::py_internal
4338
{
4439

4540
std::pair<sycl::event, sycl::event>
@@ -56,6 +51,4 @@ std::pair<sycl::event, sycl::event>
5651

5752
void init_copy_as_contig_dispatch_vectors(void);
5853

59-
} // end of namespace py_internal
60-
} // end of namespace tensor
61-
} // end of namespace dpctl
54+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/device_support_queries.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@
3939
#include <pybind11/stl.h>
4040
#include <sycl/sycl.hpp>
4141

42-
namespace dpctl
43-
{
44-
namespace tensor
45-
{
46-
namespace py_internal
42+
namespace dpctl::tensor::py_internal
4743
{
4844

45+
namespace py = pybind11;
46+
4947
namespace
5048
{
5149

@@ -61,7 +59,6 @@ std::string _default_device_fp_type(const sycl::device &d)
6159

6260
int get_numpy_major_version()
6361
{
64-
namespace py = pybind11;
6562

6663
py::module_ numpy = py::module_::import("numpy");
6764
py::str version_string = numpy.attr("__version__");
@@ -179,6 +176,4 @@ std::string default_device_index_type(const py::object &arg)
179176
return _default_device_index_type(d);
180177
}
181178

182-
} // namespace py_internal
183-
} // namespace tensor
184-
} // namespace dpctl
179+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/device_support_queries.hpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,8 @@
3636

3737
#include "dpnp4pybind11.hpp"
3838
#include <pybind11/pybind11.h>
39-
#include <pybind11/stl.h>
40-
#include <sycl/sycl.hpp>
4139

42-
namespace dpctl
43-
{
44-
namespace tensor
45-
{
46-
namespace py_internal
40+
namespace dpctl::tensor::py_internal
4741
{
4842

4943
extern std::string default_device_fp_type(const py::object &);
@@ -53,6 +47,4 @@ extern std::string default_device_bool_type(const py::object &);
5347
extern std::string default_device_complex_type(const py::object &);
5448
extern std::string default_device_index_type(const py::object &);
5549

56-
} // namespace py_internal
57-
} // namespace tensor
58-
} // namespace dpctl
50+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/simplify_iteration_space.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@
3434

3535
#include "simplify_iteration_space.hpp"
3636
#include "utils/strided_iters.hpp"
37+
#include <algorithm>
3738
#include <cstddef>
39+
#include <iterator>
3840
#include <pybind11/pybind11.h>
3941
#include <vector>
4042

41-
namespace dpctl
42-
{
43-
namespace tensor
44-
{
45-
namespace py_internal
43+
namespace dpctl::tensor::py_internal
4644
{
4745

4846
namespace py = pybind11;
@@ -539,6 +537,4 @@ std::vector<py::ssize_t> _unravel_index_f(py::ssize_t flat_index,
539537
return mi;
540538
}
541539

542-
} // namespace py_internal
543-
} // namespace tensor
544-
} // namespace dpctl
540+
} // namespace dpctl::tensor::py_internal

dpctl_ext/tensor/libtensor/source/simplify_iteration_space.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@
3636
#include <pybind11/pybind11.h>
3737
#include <vector>
3838

39-
namespace dpctl
40-
{
41-
namespace tensor
42-
{
43-
namespace py_internal
39+
namespace dpctl::tensor::py_internal
4440
{
4541

4642
namespace py = pybind11;
@@ -125,6 +121,5 @@ std::vector<py::ssize_t> _unravel_index_c(py::ssize_t,
125121
std::vector<py::ssize_t> const &);
126122
std::vector<py::ssize_t> _unravel_index_f(py::ssize_t,
127123
std::vector<py::ssize_t> const &);
128-
} // namespace py_internal
129-
} // namespace tensor
130-
} // namespace dpctl
124+
125+
} // namespace dpctl::tensor::py_internal

0 commit comments

Comments
 (0)