Skip to content

Commit 5846501

Browse files
Apply clang-format
1 parent 9e1fd55 commit 5846501

File tree

82 files changed

+488
-664
lines changed

Some content is hidden

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

82 files changed

+488
-664
lines changed

dpnp/backend/extensions/blas/gemm_batch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ struct GemmBatchContigFactory
410410
fnT get()
411411
{
412412
if constexpr (types::GemmBatchTypePairSupportFactory<Tab,
413-
Tc>::is_defined) {
413+
Tc>::is_defined)
414+
{
414415
return gemm_batch_impl<Tab, Tc>;
415416
}
416417
else {

dpnp/backend/extensions/blas/gemv.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ std::pair<sycl::event, sycl::event>
269269
const int vectorY_typenum = vectorY.get_typenum();
270270

271271
if (matrixA_typenum != vectorX_typenum ||
272-
matrixA_typenum != vectorY_typenum) {
272+
matrixA_typenum != vectorY_typenum)
273+
{
273274
throw py::value_error("Given arrays must be of the same type.");
274275
}
275276

dpnp/backend/extensions/common/ext/common.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ struct IsNan
106106
return IsNan<vT>::isnan(real1) || IsNan<vT>::isnan(imag1);
107107
}
108108
else if constexpr (std::is_floating_point_v<T> ||
109-
std::is_same_v<T, sycl::half>) {
109+
std::is_same_v<T, sycl::half>)
110+
{
110111
return sycl::isnan(v);
111112
}
112113

@@ -215,8 +216,7 @@ sycl::nd_range<1>
215216
pybind11::dtype dtype_from_typenum(int dst_typenum);
216217

217218
template <typename dispatchT,
218-
template <typename fnT, typename T>
219-
typename factoryT,
219+
template <typename fnT, typename T> typename factoryT,
220220
int _num_types = type_dispatch::num_types>
221221
inline void init_dispatch_vector(dispatchT dispatch_vector[])
222222
{
@@ -225,8 +225,7 @@ inline void init_dispatch_vector(dispatchT dispatch_vector[])
225225
}
226226

227227
template <typename dispatchT,
228-
template <typename fnT, typename D, typename S>
229-
typename factoryT,
228+
template <typename fnT, typename D, typename S> typename factoryT,
230229
int _num_types = type_dispatch::num_types>
231230
inline void init_dispatch_table(dispatchT dispatch_table[][_num_types])
232231
{

dpnp/backend/extensions/common/ext/dispatch_table.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ using SupportedDTypeList2 = std::vector<DTypePair>;
9999

100100
template <typename FnT,
101101
typename SupportedTypes,
102-
template <typename>
103-
typename Func>
102+
template <typename> typename Func>
104103
struct TableBuilder
105104
{
106105
template <typename _FnT, typename T>
@@ -125,8 +124,7 @@ struct TableBuilder
125124

126125
template <typename FnT,
127126
typename SupportedTypes,
128-
template <typename, typename>
129-
typename Func>
127+
template <typename, typename> typename Func>
130128
struct TableBuilder2
131129
{
132130
template <typename _FnT, typename T1, typename T2>
@@ -232,8 +230,7 @@ class DispatchTable2
232230
}
233231

234232
template <typename SupportedTypes,
235-
template <typename, typename>
236-
typename Func>
233+
template <typename, typename> typename Func>
237234
void populate_dispatch_table()
238235
{
239236
using TBulder = typename TableBuilder2<FnT, SupportedTypes, Func>::type;

dpnp/backend/extensions/elementwise_functions/common.hpp

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ struct UnaryTwoOutputsContigFunctor
9292
/* NOTE: work-group size must be divisible by sub-group size */
9393

9494
if constexpr (enable_sg_loadstore &&
95-
UnaryTwoOutputsOpT::is_constant::value) {
95+
UnaryTwoOutputsOpT::is_constant::value)
96+
{
9697
// value of operator is known to be a known constant
9798
constexpr resT1 const_val1 = UnaryTwoOutputsOpT::constant_value1;
9899
constexpr resT2 const_val2 = UnaryTwoOutputsOpT::constant_value2;
@@ -528,21 +529,18 @@ struct BinaryTwoOutputsStridedFunctor
528529
* dpctl::tensor::kernels::elementwise_common namespace.
529530
*/
530531
template <typename argTy,
531-
template <typename T>
532-
class UnaryTwoOutputsType,
532+
template <typename T> class UnaryTwoOutputsType,
533533
template <typename A,
534534
typename R1,
535535
typename R2,
536536
std::uint8_t vs,
537537
std::uint8_t nv,
538-
bool enable>
539-
class UnaryTwoOutputsContigFunctorT,
538+
bool enable> class UnaryTwoOutputsContigFunctorT,
540539
template <typename A,
541540
typename R1,
542541
typename R2,
543542
std::uint8_t vs,
544-
std::uint8_t nv>
545-
class kernel_name,
543+
std::uint8_t nv> class kernel_name,
546544
std::uint8_t vec_sz = 4u,
547545
std::uint8_t n_vecs = 2u>
548546
sycl::event
@@ -613,12 +611,15 @@ sycl::event
613611
* dpctl::tensor::kernels::elementwise_common namespace.
614612
*/
615613
template <typename argTy,
616-
template <typename T>
617-
class UnaryTwoOutputsType,
618-
template <typename A, typename R1, typename R2, typename I>
619-
class UnaryTwoOutputsStridedFunctorT,
620-
template <typename A, typename R1, typename R2, typename I>
621-
class kernel_name>
614+
template <typename T> class UnaryTwoOutputsType,
615+
template <typename A,
616+
typename R1,
617+
typename R2,
618+
typename I> class UnaryTwoOutputsStridedFunctorT,
619+
template <typename A,
620+
typename R1,
621+
typename R2,
622+
typename I> class kernel_name>
622623
sycl::event unary_two_outputs_strided_impl(
623624
sycl::queue &exec_q,
624625
std::size_t nelems,
@@ -665,27 +666,25 @@ sycl::event unary_two_outputs_strided_impl(
665666
* @note It extends binary_contig_impl from
666667
* dpctl::tensor::kernels::elementwise_common namespace.
667668
*/
668-
template <typename argTy1,
669-
typename argTy2,
670-
template <typename T1, typename T2>
671-
class BinaryTwoOutputsType,
672-
template <typename T1,
673-
typename T2,
674-
typename T3,
675-
typename T4,
676-
std::uint8_t vs,
677-
std::uint8_t nv,
678-
bool enable_sg_loadstore>
679-
class BinaryTwoOutputsContigFunctorT,
680-
template <typename T1,
681-
typename T2,
682-
typename T3,
683-
typename T4,
684-
std::uint8_t vs,
685-
std::uint8_t nv>
686-
class kernel_name,
687-
std::uint8_t vec_sz = 4u,
688-
std::uint8_t n_vecs = 2u>
669+
template <
670+
typename argTy1,
671+
typename argTy2,
672+
template <typename T1, typename T2> class BinaryTwoOutputsType,
673+
template <typename T1,
674+
typename T2,
675+
typename T3,
676+
typename T4,
677+
std::uint8_t vs,
678+
std::uint8_t nv,
679+
bool enable_sg_loadstore> class BinaryTwoOutputsContigFunctorT,
680+
template <typename T1,
681+
typename T2,
682+
typename T3,
683+
typename T4,
684+
std::uint8_t vs,
685+
std::uint8_t nv> class kernel_name,
686+
std::uint8_t vec_sz = 4u,
687+
std::uint8_t n_vecs = 2u>
689688
sycl::event
690689
binary_two_outputs_contig_impl(sycl::queue &exec_q,
691690
std::size_t nelems,
@@ -761,15 +760,19 @@ sycl::event
761760
* @note It extends binary_strided_impl from
762761
* dpctl::tensor::kernels::elementwise_common namespace.
763762
*/
764-
template <
765-
typename argTy1,
766-
typename argTy2,
767-
template <typename T1, typename T2>
768-
class BinaryTwoOutputsType,
769-
template <typename T1, typename T2, typename T3, typename T4, typename IndT>
770-
class BinaryTwoOutputsStridedFunctorT,
771-
template <typename T1, typename T2, typename T3, typename T4, typename IndT>
772-
class kernel_name>
763+
template <typename argTy1,
764+
typename argTy2,
765+
template <typename T1, typename T2> class BinaryTwoOutputsType,
766+
template <typename T1,
767+
typename T2,
768+
typename T3,
769+
typename T4,
770+
typename IndT> class BinaryTwoOutputsStridedFunctorT,
771+
template <typename T1,
772+
typename T2,
773+
typename T3,
774+
typename T4,
775+
typename IndT> class kernel_name>
773776
sycl::event binary_two_outputs_strided_impl(
774777
sycl::queue &exec_q,
775778
std::size_t nelems,

dpnp/backend/extensions/elementwise_functions/elementwise_functions.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ std::pair<sycl::event, sycl::event>
189189
simplified_dst_strides, 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
// Special case of contiguous data
194195
auto contig_fn = contig_dispatch_vector[src_typeid];
195196

@@ -893,7 +894,8 @@ std::pair<sycl::event, sycl::event>
893894
output_types_table[src1_typeid][src2_typeid];
894895

895896
if (dst1_typeid != output_typeids.first ||
896-
dst2_typeid != output_typeids.second) {
897+
dst2_typeid != output_typeids.second)
898+
{
897899
throw py::value_error(
898900
"One of destination arrays has unexpected elemental data type.");
899901
}

dpnp/backend/extensions/elementwise_functions/simplify_iteration_space.cpp

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

185185
if ((src1_strides[0] < 0) && (src2_strides[0] < 0) &&
186-
(dst_strides[0] < 0)) {
186+
(dst_strides[0] < 0))
187+
{
187188
simplified_src1_strides.push_back(-src1_strides[0]);
188189
simplified_src2_strides.push_back(-src2_strides[0]);
189190
simplified_dst_strides.push_back(-dst_strides[0]);

dpnp/backend/extensions/fft/common.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ class DescriptorWrapper
6666
queue_ptr_ = std::make_unique<sycl::queue>(q);
6767
}
6868

69-
descr_type &get_descriptor()
70-
{
71-
return descr_;
72-
}
69+
descr_type &get_descriptor() { return descr_; }
7370

7471
const sycl::queue &get_queue() const
7572
{

dpnp/backend/extensions/indexing/choose.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ std::pair<sycl::event, sycl::event>
299299
}
300300

301301
if (!(chc_type_id ==
302-
array_types.typenum_to_lookup_id(chc_.get_typenum()))) {
302+
array_types.typenum_to_lookup_id(chc_.get_typenum())))
303+
{
303304
throw py::type_error(
304305
"Choice array data types are not all the same.");
305306
}
@@ -420,7 +421,8 @@ struct ChooseFactory
420421
fnT get()
421422
{
422423
if constexpr (std::is_integral<IndT>::value &&
423-
!std::is_same<IndT, bool>::value) {
424+
!std::is_same<IndT, bool>::value)
425+
{
424426
fnT fn = kernels::choose_impl<Index, IndT, T>;
425427
return fn;
426428
}

dpnp/backend/extensions/lapack/geqrf_batch.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ static sycl::event geqrf_batch_impl(sycl::queue &exec_q,
9898

9999
geqrf_batch_event = mkl_lapack::geqrf_batch(
100100
exec_q,
101-
m, // The number of rows in each matrix in the batch; (0 ≤ m).
102-
// It must be a non-negative integer.
103-
n, // The number of columns in each matrix in the batch; (0 ≤ n).
104-
// It must be a non-negative integer.
105-
a, // Pointer to the batch of matrices, each of size (m x n).
106-
lda, // The leading dimension of each matrix in the batch.
107-
// For row major layout, lda ≥ max(1, m).
101+
m, // The number of rows in each matrix in the batch; (0 ≤ m).
102+
// It must be a non-negative integer.
103+
n, // The number of columns in each matrix in the batch; (0 ≤ n).
104+
// It must be a non-negative integer.
105+
a, // Pointer to the batch of matrices, each of size (m x n).
106+
lda, // The leading dimension of each matrix in the batch.
107+
// For row major layout, lda ≥ max(1, m).
108108
stride_a, // Stride between consecutive matrices in the batch.
109109
tau, // Pointer to the array of scalar factors of the elementary
110110
// reflectors for each matrix in the batch.

0 commit comments

Comments
 (0)