Skip to content

Commit 6588df0

Browse files
Address formatting violations due to transition from clang-format 11 to 18
1 parent 3b89a5b commit 6588df0

24 files changed

+87
-95
lines changed

dpctl/tensor/libtensor/source/boolean_advanced_indexing.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ py_extract(const dpctl::tensor::usm_ndarray &src,
170170
// masked_dst_nelems is number of set elements in the mask, or last element
171171
// in cumsum
172172
if (!same_ortho_dims ||
173-
(masked_src_nelems != static_cast<size_t>(cumsum_sz))) {
173+
(masked_src_nelems != static_cast<size_t>(cumsum_sz)))
174+
{
174175
throw py::value_error("Inconsistent array dimensions");
175176
}
176177

@@ -492,7 +493,8 @@ py_place(const dpctl::tensor::usm_ndarray &dst,
492493
}
493494

494495
if (!same_ortho_dims ||
495-
(masked_dst_nelems != static_cast<size_t>(cumsum_sz))) {
496+
(masked_dst_nelems != static_cast<size_t>(cumsum_sz)))
497+
{
496498
throw py::value_error("Inconsistent array dimensions");
497499
}
498500

dpctl/tensor/libtensor/source/copy_for_roll.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ copy_usm_ndarray_for_roll_1d(const dpctl::tensor::usm_ndarray &src,
189189
src_offset, dst_offset);
190190

191191
if (nd == 1 && simplified_src_strides[0] == 1 &&
192-
simplified_dst_strides[0] == 1) {
192+
simplified_dst_strides[0] == 1)
193+
{
193194
auto fn = copy_for_roll_contig_dispatch_vector[type_id];
194195

195196
if (fn != nullptr) {

dpctl/tensor/libtensor/source/device_support_queries.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,9 @@ std::string _default_device_complex_type(const sycl::device &d)
103103
}
104104
}
105105

106-
std::string _default_device_bool_type(const sycl::device &)
107-
{
108-
return "b1";
109-
}
106+
std::string _default_device_bool_type(const sycl::device &) { return "b1"; }
110107

111-
std::string _default_device_index_type(const sycl::device &)
112-
{
113-
return "i8";
114-
}
108+
std::string _default_device_index_type(const sycl::device &) { return "i8"; }
115109

116110
sycl::device _extract_device(const py::object &arg)
117111
{

dpctl/tensor/libtensor/source/elementwise_functions/elementwise_functions.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ py_unary_ufunc(const dpctl::tensor::usm_ndarray &src,
181181
src_offset, dst_offset);
182182

183183
if (nd == 1 && simplified_src_strides[0] == 1 &&
184-
simplified_dst_strides[0] == 1) {
184+
simplified_dst_strides[0] == 1)
185+
{
185186
// Special case of contiguous data
186187
auto contig_fn = contig_dispatch_vector[src_typeid];
187188

dpctl/tensor/libtensor/source/integer_advanced_indexing.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ usm_ndarray_take(const dpctl::tensor::usm_ndarray &src,
382382
}
383383

384384
if (!(ind_type_id ==
385-
array_types.typenum_to_lookup_id(ind_.get_typenum()))) {
385+
array_types.typenum_to_lookup_id(ind_.get_typenum())))
386+
{
386387
throw py::type_error(
387388
"Indices array data types are not all the same.");
388389
}
@@ -689,7 +690,8 @@ usm_ndarray_put(const dpctl::tensor::usm_ndarray &dst,
689690
}
690691

691692
if (!(ind_type_id ==
692-
array_types.typenum_to_lookup_id(ind_.get_typenum()))) {
693+
array_types.typenum_to_lookup_id(ind_.get_typenum())))
694+
{
693695
throw py::type_error(
694696
"Indices array data types are not all the same.");
695697
}

dpctl/tensor/libtensor/source/linalg_functions/dot.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ py_dot(const dpctl::tensor::usm_ndarray &x1,
239239
}
240240
size_t x1_outer_nelems(1);
241241
for (int i = batch_dims; same_shapes && (i < (batch_dims + x1_outer_dims));
242-
++i) {
242+
++i)
243+
{
243244
same_shapes = same_shapes && (x1_shape_ptr[i] == dst_shape_ptr[i]);
244245
x1_outer_nelems *= x1_shape_ptr[i];
245246
}
@@ -419,7 +420,8 @@ py_dot(const dpctl::tensor::usm_ndarray &x1,
419420
bool reduce_all_elems = false;
420421

421422
if (simplified_inner_x1_strides[0] == 1 &&
422-
simplified_inner_x2_strides[0] == 1) {
423+
simplified_inner_x2_strides[0] == 1)
424+
{
423425
reduce_all_elems = (simplified_batch_shape[0] == 1);
424426
dot_product_c_contig =
425427
(simplified_batch_dst_strides[0] == 1) &&

dpctl/tensor/libtensor/source/reductions/argmax.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ struct ArgmaxOverAxisTempsStridedFactory
126126
dstTy>::is_defined)
127127
{
128128
if constexpr (std::is_integral_v<srcTy> &&
129-
!std::is_same_v<srcTy, bool>) {
129+
!std::is_same_v<srcTy, bool>)
130+
{
130131
// op for values
131132
using ReductionOpT = sycl::maximum<srcTy>;
132133
// op for indices
@@ -160,7 +161,8 @@ struct ArgmaxOverAxis1TempsContigFactory
160161
dstTy>::is_defined)
161162
{
162163
if constexpr (std::is_integral_v<srcTy> &&
163-
!std::is_same_v<srcTy, bool>) {
164+
!std::is_same_v<srcTy, bool>)
165+
{
164166
// op for values
165167
using ReductionOpT = sycl::maximum<srcTy>;
166168
// op for indices
@@ -194,7 +196,8 @@ struct ArgmaxOverAxis0TempsContigFactory
194196
dstTy>::is_defined)
195197
{
196198
if constexpr (std::is_integral_v<srcTy> &&
197-
!std::is_same_v<srcTy, bool>) {
199+
!std::is_same_v<srcTy, bool>)
200+
{
198201
// op for values
199202
using ReductionOpT = sycl::maximum<srcTy>;
200203
// op for indices

dpctl/tensor/libtensor/source/reductions/argmin.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ struct ArgminOverAxisTempsStridedFactory
126126
dstTy>::is_defined)
127127
{
128128
if constexpr (std::is_integral_v<srcTy> &&
129-
!std::is_same_v<srcTy, bool>) {
129+
!std::is_same_v<srcTy, bool>)
130+
{
130131
// op for values
131132
using ReductionOpT = sycl::minimum<srcTy>;
132133
// op for indices
@@ -160,7 +161,8 @@ struct ArgminOverAxis1TempsContigFactory
160161
dstTy>::is_defined)
161162
{
162163
if constexpr (std::is_integral_v<srcTy> &&
163-
!std::is_same_v<srcTy, bool>) {
164+
!std::is_same_v<srcTy, bool>)
165+
{
164166
// op for values
165167
using ReductionOpT = sycl::minimum<srcTy>;
166168
// op for indices
@@ -194,7 +196,8 @@ struct ArgminOverAxis0TempsContigFactory
194196
dstTy>::is_defined)
195197
{
196198
if constexpr (std::is_integral_v<srcTy> &&
197-
!std::is_same_v<srcTy, bool>) {
199+
!std::is_same_v<srcTy, bool>)
200+
{
198201
// op for values
199202
using ReductionOpT = sycl::minimum<srcTy>;
200203
// op for indices

dpctl/tensor/libtensor/source/reductions/max.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,11 @@ struct MaxOverAxisTempsStridedFactory
183183
fnT get() const
184184
{
185185
if constexpr (TypePairSupportDataForMaxReductionTemps<
186-
srcTy, dstTy>::is_defined) {
186+
srcTy, dstTy>::is_defined)
187+
{
187188
if constexpr (std::is_integral_v<dstTy> &&
188-
!std::is_same_v<dstTy, bool>) {
189+
!std::is_same_v<dstTy, bool>)
190+
{
189191
using ReductionOpT = sycl::maximum<dstTy>;
190192
return dpctl::tensor::kernels::
191193
reduction_over_group_temps_strided_impl<srcTy, dstTy,
@@ -264,9 +266,11 @@ struct MaxOverAxis1TempsContigFactory
264266
fnT get() const
265267
{
266268
if constexpr (TypePairSupportDataForMaxReductionTemps<
267-
srcTy, dstTy>::is_defined) {
269+
srcTy, dstTy>::is_defined)
270+
{
268271
if constexpr (std::is_integral_v<dstTy> &&
269-
!std::is_same_v<dstTy, bool>) {
272+
!std::is_same_v<dstTy, bool>)
273+
{
270274
using ReductionOpT = sycl::maximum<dstTy>;
271275
return dpctl::tensor::kernels::
272276
reduction_axis1_over_group_temps_contig_impl<srcTy, dstTy,
@@ -291,9 +295,11 @@ struct MaxOverAxis0TempsContigFactory
291295
fnT get() const
292296
{
293297
if constexpr (TypePairSupportDataForMaxReductionTemps<
294-
srcTy, dstTy>::is_defined) {
298+
srcTy, dstTy>::is_defined)
299+
{
295300
if constexpr (std::is_integral_v<dstTy> &&
296-
!std::is_same_v<dstTy, bool>) {
301+
!std::is_same_v<dstTy, bool>)
302+
{
297303
using ReductionOpT = sycl::maximum<dstTy>;
298304
return dpctl::tensor::kernels::
299305
reduction_axis0_over_group_temps_contig_impl<srcTy, dstTy,

dpctl/tensor/libtensor/source/reductions/min.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,11 @@ struct MinOverAxisTempsStridedFactory
183183
fnT get() const
184184
{
185185
if constexpr (TypePairSupportDataForMinReductionTemps<
186-
srcTy, dstTy>::is_defined) {
186+
srcTy, dstTy>::is_defined)
187+
{
187188
if constexpr (std::is_integral_v<dstTy> &&
188-
!std::is_same_v<dstTy, bool>) {
189+
!std::is_same_v<dstTy, bool>)
190+
{
189191
using ReductionOpT = sycl::minimum<dstTy>;
190192
return dpctl::tensor::kernels::
191193
reduction_over_group_temps_strided_impl<srcTy, dstTy,
@@ -264,9 +266,11 @@ struct MinOverAxis1TempsContigFactory
264266
fnT get() const
265267
{
266268
if constexpr (TypePairSupportDataForMinReductionTemps<
267-
srcTy, dstTy>::is_defined) {
269+
srcTy, dstTy>::is_defined)
270+
{
268271
if constexpr (std::is_integral_v<dstTy> &&
269-
!std::is_same_v<dstTy, bool>) {
272+
!std::is_same_v<dstTy, bool>)
273+
{
270274
using ReductionOpT = sycl::minimum<dstTy>;
271275
return dpctl::tensor::kernels::
272276
reduction_axis1_over_group_temps_contig_impl<srcTy, dstTy,
@@ -291,9 +295,11 @@ struct MinOverAxis0TempsContigFactory
291295
fnT get() const
292296
{
293297
if constexpr (TypePairSupportDataForMinReductionTemps<
294-
srcTy, dstTy>::is_defined) {
298+
srcTy, dstTy>::is_defined)
299+
{
295300
if constexpr (std::is_integral_v<dstTy> &&
296-
!std::is_same_v<dstTy, bool>) {
301+
!std::is_same_v<dstTy, bool>)
302+
{
297303
using ReductionOpT = sycl::minimum<dstTy>;
298304
return dpctl::tensor::kernels::
299305
reduction_axis0_over_group_temps_contig_impl<srcTy, dstTy,

dpctl/tensor/libtensor/source/reductions/reduction_atomic_support.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ template <typename fnT, typename T> struct ArithmeticAtomicSupportFactory
110110

111111
template <typename fnT, typename T> struct MinMaxAtomicSupportFactory
112112
{
113-
fnT get()
114-
{
115-
return check_atomic_support<T>;
116-
}
113+
fnT get() { return check_atomic_support<T>; }
117114
};
118115

119116
template <typename fnT, typename T>

dpctl/tensor/libtensor/source/reductions/reduction_over_axis.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,8 @@ std::pair<sycl::event, sycl::event> py_search_over_axis(
976976
reduction_nelems);
977977
}
978978
else if (static_cast<size_t>(compact_reduction_src_strides[0]) ==
979-
iter_nelems) {
979+
iter_nelems)
980+
{
980981
mat_reduce_over_axis0 =
981982
(simplified_iteration_dst_strides[0] == 1) &&
982983
(simplified_iteration_src_strides[0] == 1);
@@ -1257,7 +1258,8 @@ py_boolean_reduction(const dpctl::tensor::usm_ndarray &src,
12571258
red_nelems);
12581259
}
12591260
else if (static_cast<size_t>(simplified_red_src_strides[0]) ==
1260-
iter_nelems) {
1261+
iter_nelems)
1262+
{
12611263
mat_reduce_over_axis0 = (simplified_iter_dst_strides[0] == 1) &&
12621264
(simplified_iter_src_strides[0] == 1);
12631265
}

dpctl/tensor/libtensor/source/reductions/sum.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ struct SumOverAxisTempsStridedFactory
257257
fnT get() const
258258
{
259259
if constexpr (TypePairSupportDataForSumReductionTemps<
260-
srcTy, dstTy>::is_defined) {
260+
srcTy, dstTy>::is_defined)
261+
{
261262
using ReductionOpT = sycl::plus<dstTy>;
262263
return dpctl::tensor::kernels::
263264
reduction_over_group_temps_strided_impl<srcTy, dstTy,
@@ -313,7 +314,8 @@ struct SumOverAxis1TempsContigFactory
313314
fnT get() const
314315
{
315316
if constexpr (TypePairSupportDataForSumReductionTemps<
316-
srcTy, dstTy>::is_defined) {
317+
srcTy, dstTy>::is_defined)
318+
{
317319
using ReductionOpT = sycl::plus<dstTy>;
318320
return dpctl::tensor::kernels::
319321
reduction_axis1_over_group_temps_contig_impl<srcTy, dstTy,
@@ -331,7 +333,8 @@ struct SumOverAxis0TempsContigFactory
331333
fnT get() const
332334
{
333335
if constexpr (TypePairSupportDataForSumReductionTemps<
334-
srcTy, dstTy>::is_defined) {
336+
srcTy, dstTy>::is_defined)
337+
{
335338
using ReductionOpT = sycl::plus<dstTy>;
336339
return dpctl::tensor::kernels::
337340
reduction_axis0_over_group_temps_contig_impl<srcTy, dstTy,

dpctl/tensor/libtensor/source/repeat.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ py_repeat_by_sequence(const dpctl::tensor::usm_ndarray &src,
101101
{
102102
int src_nd = src.get_ndim();
103103
if (axis < 0 || (axis + 1 > src_nd && src_nd > 0) ||
104-
(axis > 0 && src_nd == 0)) {
104+
(axis > 0 && src_nd == 0))
105+
{
105106
throw py::value_error("Specified axis is invalid.");
106107
}
107108

@@ -517,7 +518,8 @@ py_repeat_by_scalar(const dpctl::tensor::usm_ndarray &src,
517518
{
518519
int src_nd = src.get_ndim();
519520
if (axis < 0 || (axis + 1 > src_nd && src_nd > 0) ||
520-
(axis > 0 && src_nd == 0)) {
521+
(axis > 0 && src_nd == 0))
522+
{
521523
throw py::value_error("Specified axis is invalid.");
522524
}
523525

dpctl/tensor/libtensor/source/simplify_iteration_space.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ void simplify_iteration_space_3(
233233
simplified_dst_strides.reserve(nd);
234234

235235
if ((src1_strides[0] < 0) && (src2_strides[0] < 0) &&
236-
(dst_strides[0] < 0)) {
236+
(dst_strides[0] < 0))
237+
{
237238
simplified_src1_strides.push_back(-src1_strides[0]);
238239
simplified_src2_strides.push_back(-src2_strides[0]);
239240
simplified_dst_strides.push_back(-dst_strides[0]);

dpctl/tensor/libtensor/source/sorting/rich_comparisons.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ template <typename cT> struct ExtendedComplexFPGreater
9999
};
100100

101101
template <typename T>
102-
inline constexpr bool is_fp_v = (std::is_same_v<T, sycl::half> ||
103-
std::is_same_v<T, float> ||
104-
std::is_same_v<T, double>);
102+
inline constexpr bool is_fp_v =
103+
(std::is_same_v<T, sycl::half> || std::is_same_v<T, float> ||
104+
std::is_same_v<T, double>);
105105

106106
} // end of anonymous namespace
107107

dpctl/utils/src/sequential_order_keeper.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ class SequentialOrder
7676
return *this;
7777
}
7878

79-
size_t get_num_submitted_events() const
80-
{
81-
return submitted_events.size();
82-
}
79+
size_t get_num_submitted_events() const { return submitted_events.size(); }
8380

8481
const std::vector<sycl::event> &get_host_task_events()
8582
{
@@ -93,10 +90,7 @@ class SequentialOrder
9390
}
9491
*/
9592

96-
size_t get_num_host_task_events() const
97-
{
98-
return host_task_events.size();
99-
}
93+
size_t get_num_host_task_events() const { return host_task_events.size(); }
10094

10195
const std::vector<sycl::event> &get_submitted_events()
10296
{

libsyclinterface/source/dpctl_service.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,12 @@ void DPCTLService_InitLogger(const char *app_name, const char *log_dir)
6565
}
6666
}
6767

68-
void DPCTLService_ShutdownLogger(void)
69-
{
70-
google::ShutdownGoogleLogging();
71-
}
68+
void DPCTLService_ShutdownLogger(void) { google::ShutdownGoogleLogging(); }
7269

7370
#else
7471
void DPCTLService_InitLogger([[maybe_unused]] const char *app_name,
75-
[[maybe_unused]] const char *log_dir){};
72+
[[maybe_unused]] const char *log_dir) {};
7673

77-
void DPCTLService_ShutdownLogger(void){};
74+
void DPCTLService_ShutdownLogger(void) {};
7875

7976
#endif

0 commit comments

Comments
 (0)