Skip to content

Commit 819262d

Browse files
Make immutable variables const
1 parent ddd2ec0 commit 819262d

File tree

1 file changed

+18
-18
lines changed
  • dpnp/backend/extensions/ufunc/elementwise_functions

1 file changed

+18
-18
lines changed

dpnp/backend/extensions/ufunc/elementwise_functions/isclose.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ using value_type_of_t = typename value_type_of<T>::type;
8080

8181
typedef sycl::event (*isclose_strided_scalar_fn_ptr_t)(
8282
sycl::queue &,
83-
int, // nd
84-
std::size_t, // nelems
83+
const int, // nd
84+
const std::size_t, // nelems
8585
const py::ssize_t *, // shape_strides
8686
const py::object &, // rtol
8787
const py::object &, // atol
@@ -96,8 +96,8 @@ typedef sycl::event (*isclose_strided_scalar_fn_ptr_t)(
9696

9797
template <typename T>
9898
sycl::event isclose_strided_scalar_call(sycl::queue &exec_q,
99-
int nd,
100-
std::size_t nelems,
99+
const int nd,
100+
const std::size_t nelems,
101101
const py::ssize_t *shape_strides,
102102
const py::object &py_rtol,
103103
const py::object &py_atol,
@@ -124,7 +124,7 @@ sycl::event isclose_strided_scalar_call(sycl::queue &exec_q,
124124

125125
typedef sycl::event (*isclose_contig_scalar_fn_ptr_t)(
126126
sycl::queue &,
127-
std::size_t, // nelems
127+
const std::size_t, // nelems
128128
const py::object &, // rtol
129129
const py::object &, // atol
130130
const py::object &, // equal_nan
@@ -135,7 +135,7 @@ typedef sycl::event (*isclose_contig_scalar_fn_ptr_t)(
135135

136136
template <typename T>
137137
sycl::event isclose_contig_scalar_call(sycl::queue &q,
138-
std::size_t nelems,
138+
const std::size_t nelems,
139139
const py::object &py_rtol,
140140
const py::object &py_atol,
141141
const py::object &py_equal_nan,
@@ -214,17 +214,19 @@ std::pair<sycl::event, sycl::event>
214214
char *res_data = res.get_data();
215215

216216
// handle contiguous inputs
217-
bool is_a_c_contig = a.is_c_contiguous();
218-
bool is_a_f_contig = a.is_f_contiguous();
217+
const bool is_a_c_contig = a.is_c_contiguous();
218+
const bool is_a_f_contig = a.is_f_contiguous();
219219

220-
bool is_b_c_contig = b.is_c_contiguous();
221-
bool is_b_f_contig = b.is_f_contiguous();
220+
const bool is_b_c_contig = b.is_c_contiguous();
221+
const bool is_b_f_contig = b.is_f_contiguous();
222222

223-
bool is_res_c_contig = res.is_c_contiguous();
224-
bool is_res_f_contig = res.is_f_contiguous();
223+
const bool is_res_c_contig = res.is_c_contiguous();
224+
const bool is_res_f_contig = res.is_f_contiguous();
225225

226-
bool all_c_contig = (is_a_c_contig && is_b_c_contig && is_res_c_contig);
227-
bool all_f_contig = (is_a_f_contig && is_b_f_contig && is_res_f_contig);
226+
const bool all_c_contig =
227+
(is_a_c_contig && is_b_c_contig && is_res_c_contig);
228+
const bool all_f_contig =
229+
(is_a_f_contig && is_b_f_contig && is_res_f_contig);
228230

229231
if (all_c_contig || all_f_contig) {
230232
auto contig_fn = isclose_contig_dispatch_vector[a_b_typeid];
@@ -362,8 +364,7 @@ struct IsCloseStridedScalarFactory
362364
fnT get()
363365
{
364366
if constexpr (std::is_same_v<typename IsCloseOutputType<T>::value_type,
365-
void>)
366-
{
367+
void>) {
367368
return nullptr;
368369
}
369370
else {
@@ -378,8 +379,7 @@ struct IsCloseContigScalarFactory
378379
fnT get()
379380
{
380381
if constexpr (std::is_same_v<typename IsCloseOutputType<T>::value_type,
381-
void>)
382-
{
382+
void>) {
383383
return nullptr;
384384
}
385385
else {

0 commit comments

Comments
 (0)