Skip to content

Commit 936fe68

Browse files
Remove const qualifiers for class/struct members per C++ guidelines
1 parent 14a0cf4 commit 936fe68

File tree

16 files changed

+127
-123
lines changed

16 files changed

+127
-123
lines changed

dpctl/tensor/libtensor/include/kernels/boolean_advanced_indexing.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ struct MaskedExtractStridedFunctor
116116
const dataT *src = nullptr;
117117
const indT *cumsum = nullptr;
118118
dataT *dst = nullptr;
119-
const std::size_t masked_nelems = 0;
119+
std::size_t masked_nelems = 0;
120120
// has nd, shape, src_strides, dst_strides for
121121
// dimensions that ARE NOT masked
122-
const OrthogIndexerT orthog_src_dst_indexer;
122+
OrthogIndexerT orthog_src_dst_indexer;
123123
// has nd, shape, src_strides for
124124
// dimensions that ARE masked
125-
const MaskedSrcIndexerT masked_src_indexer;
125+
MaskedSrcIndexerT masked_src_indexer;
126126
// has 1, dst_strides for dimensions that ARE masked
127-
const MaskedDstIndexerT masked_dst_indexer;
127+
MaskedDstIndexerT masked_dst_indexer;
128128
LocalAccessorT lacc;
129129
};
130130

@@ -198,15 +198,15 @@ struct MaskedPlaceStridedFunctor
198198
dataT *dst = nullptr;
199199
const indT *cumsum = nullptr;
200200
const dataT *rhs = nullptr;
201-
const std::size_t masked_nelems = 0;
201+
std::size_t masked_nelems = 0;
202202
// has nd, shape, dst_strides, rhs_strides for
203203
// dimensions that ARE NOT masked
204-
const OrthogIndexerT orthog_dst_rhs_indexer;
204+
OrthogIndexerT orthog_dst_rhs_indexer;
205205
// has nd, shape, dst_strides for
206206
// dimensions that ARE masked
207-
const MaskedDstIndexerT masked_dst_indexer;
207+
MaskedDstIndexerT masked_dst_indexer;
208208
// has 1, rhs_strides for dimensions that ARE masked
209-
const MaskedRhsIndexerT masked_rhs_indexer;
209+
MaskedRhsIndexerT masked_rhs_indexer;
210210
LocalAccessorT lacc;
211211
};
212212

dpctl/tensor/libtensor/include/kernels/clip.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ template <typename T, typename IndexerT> class ClipStridedFunctor
245245
const T *min_p = nullptr;
246246
const T *max_p = nullptr;
247247
T *dst_p = nullptr;
248-
const IndexerT indexer;
248+
IndexerT indexer;
249249

250250
public:
251251
ClipStridedFunctor(const T *x_p_,

dpctl/tensor/libtensor/include/kernels/constructors.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ template <typename Ty, typename IndexerT> class FullStridedFunctor
260260
{
261261
private:
262262
Ty *p = nullptr;
263-
const Ty fill_v;
264-
const IndexerT indexer;
263+
Ty fill_v;
264+
IndexerT indexer;
265265

266266
public:
267267
FullStridedFunctor(Ty *p_, const Ty &fill_v_, const IndexerT &indexer_)

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class GenericCopyFunctor
8787
private:
8888
const srcT *src_ = nullptr;
8989
dstT *dst_ = nullptr;
90-
const IndexerT indexer_;
90+
IndexerT indexer_;
9191

9292
public:
9393
GenericCopyFunctor(const srcT *src_p, dstT *dst_p, const IndexerT &indexer)
@@ -219,7 +219,7 @@ template <typename srcT,
219219
class ContigCopyFunctor
220220
{
221221
private:
222-
const std::size_t nelems;
222+
std::size_t nelems;
223223
const srcT *src_p = nullptr;
224224
dstT *dst_p = nullptr;
225225

@@ -524,9 +524,9 @@ template <typename AccessorT,
524524
class GenericCopyFromHostFunctor
525525
{
526526
private:
527-
const AccessorT src_acc_;
527+
AccessorT src_acc_;
528528
dstTy *dst_ = nullptr;
529-
const IndexerT indexer_;
529+
IndexerT indexer_;
530530

531531
public:
532532
GenericCopyFromHostFunctor(const AccessorT &src_acc,
@@ -771,8 +771,8 @@ class GenericCopyForReshapeFunctor
771771
private:
772772
const Ty *src_p = nullptr;
773773
Ty *dst_p = nullptr;
774-
const SrcIndexerT src_indexer_;
775-
const DstIndexerT dst_indexer_;
774+
SrcIndexerT src_indexer_;
775+
DstIndexerT dst_indexer_;
776776

777777
public:
778778
GenericCopyForReshapeFunctor(const char *src_ptr,
@@ -963,8 +963,8 @@ class StridedCopyForRollFunctor
963963
private:
964964
const Ty *src_p = nullptr;
965965
Ty *dst_p = nullptr;
966-
const SrcIndexerT src_indexer_;
967-
const DstIndexerT dst_indexer_;
966+
SrcIndexerT src_indexer_;
967+
DstIndexerT dst_indexer_;
968968

969969
public:
970970
StridedCopyForRollFunctor(const Ty *src_ptr,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ template <typename T,
5555
class CopyAsCContigFunctor
5656
{
5757
private:
58-
const std::size_t nelems;
58+
std::size_t nelems;
5959
const T *src_p = nullptr;
6060
T *dst_p = nullptr;
6161
IndexerT src_indexer;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/common.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct UnaryContigFunctor
6565
private:
6666
const argT *in = nullptr;
6767
resT *out = nullptr;
68-
const std::size_t nelems_;
68+
std::size_t nelems_;
6969

7070
public:
7171
UnaryContigFunctor(const argT *inp, resT *res, const std::size_t n_elems)
@@ -245,7 +245,7 @@ struct UnaryStridedFunctor
245245
private:
246246
const argT *inp_ = nullptr;
247247
resT *res_ = nullptr;
248-
const IndexerT inp_out_indexer_;
248+
IndexerT inp_out_indexer_;
249249

250250
public:
251251
UnaryStridedFunctor(const argT *inp_p,
@@ -397,7 +397,7 @@ struct BinaryContigFunctor
397397
const argT1 *in1 = nullptr;
398398
const argT2 *in2 = nullptr;
399399
resT *out = nullptr;
400-
const std::size_t nelems_;
400+
std::size_t nelems_;
401401

402402
public:
403403
BinaryContigFunctor(const argT1 *inp1,
@@ -529,7 +529,7 @@ struct BinaryStridedFunctor
529529
const argT1 *in1 = nullptr;
530530
const argT2 *in2 = nullptr;
531531
resT *out = nullptr;
532-
const ThreeOffsets_IndexerT three_offsets_indexer_;
532+
ThreeOffsets_IndexerT three_offsets_indexer_;
533533

534534
public:
535535
BinaryStridedFunctor(const argT1 *inp1_tp,

dpctl/tensor/libtensor/include/kernels/elementwise_functions/common_inplace.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct BinaryInplaceContigFunctor
6464
private:
6565
const argT *rhs = nullptr;
6666
resT *lhs = nullptr;
67-
const std::size_t nelems_;
67+
std::size_t nelems_;
6868

6969
public:
7070
BinaryInplaceContigFunctor(const argT *rhs_tp,
@@ -185,7 +185,7 @@ struct BinaryInplaceStridedFunctor
185185
private:
186186
const argT *rhs = nullptr;
187187
resT *lhs = nullptr;
188-
const TwoOffsets_IndexerT two_offsets_indexer_;
188+
TwoOffsets_IndexerT two_offsets_indexer_;
189189

190190
public:
191191
BinaryInplaceStridedFunctor(const argT *rhs_tp,

dpctl/tensor/libtensor/include/kernels/integer_advanced_indexing.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ class TakeFunctor
6161
int k_ = 0;
6262
std::size_t ind_nelems_ = 0;
6363
const ssize_t *axes_shape_and_strides_ = nullptr;
64-
const OrthogIndexer orthog_strider;
65-
const IndicesIndexer ind_strider;
66-
const AxesIndexer axes_strider;
64+
OrthogIndexer orthog_strider;
65+
IndicesIndexer ind_strider;
66+
AxesIndexer axes_strider;
6767

6868
public:
6969
TakeFunctor(const char *src_cp,
@@ -207,9 +207,9 @@ class PutFunctor
207207
int k_ = 0;
208208
std::size_t ind_nelems_ = 0;
209209
const ssize_t *axes_shape_and_strides_ = nullptr;
210-
const OrthogIndexer orthog_strider;
211-
const IndicesIndexer ind_strider;
212-
const AxesIndexer axes_strider;
210+
OrthogIndexer orthog_strider;
211+
IndicesIndexer ind_strider;
212+
AxesIndexer axes_strider;
213213

214214
public:
215215
PutFunctor(char *dst_cp,

dpctl/tensor/libtensor/include/kernels/linalg_functions/dot_product.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ struct DotProductFunctor
115115
const lhsT *lhs_ = nullptr;
116116
const rhsT *rhs_ = nullptr;
117117
outT *out_ = nullptr;
118-
const ReductionOpT reduction_op_;
119-
const BatchIndexerT batch_indexer_;
120-
const RedIndexerT reduced_dims_indexer_;
118+
ReductionOpT reduction_op_;
119+
BatchIndexerT batch_indexer_;
120+
RedIndexerT reduced_dims_indexer_;
121121
std::size_t reduction_max_gid_ = 0;
122122
std::size_t batches_ = 1;
123123
std::size_t reductions_per_wi = 16;
@@ -211,9 +211,9 @@ struct DotProductCustomFunctor
211211
const lhsT *lhs_ = nullptr;
212212
const rhsT *rhs_ = nullptr;
213213
outT *out_ = nullptr;
214-
const ReductionOpT reduction_op_;
215-
const BatchIndexerT batch_indexer_;
216-
const RedIndexerT reduced_dims_indexer_;
214+
ReductionOpT reduction_op_;
215+
BatchIndexerT batch_indexer_;
216+
RedIndexerT reduced_dims_indexer_;
217217
SlmT local_mem_;
218218
std::size_t reduction_max_gid_ = 0;
219219
std::size_t batches_ = 1;
@@ -657,9 +657,9 @@ struct DotProductNoAtomicFunctor
657657
const lhsT *lhs_ = nullptr;
658658
const rhsT *rhs_ = nullptr;
659659
outT *out_ = nullptr;
660-
const ReductionOpT reduction_op_;
661-
const BatchIndexerT batch_indexer_;
662-
const RedIndexerT reduced_dims_indexer_;
660+
ReductionOpT reduction_op_;
661+
BatchIndexerT batch_indexer_;
662+
RedIndexerT reduced_dims_indexer_;
663663
std::size_t reduction_max_gid_ = 0;
664664
std::size_t batches_ = 1;
665665
std::size_t reductions_per_wi = 16;
@@ -756,9 +756,9 @@ struct DotProductNoAtomicCustomFunctor
756756
const lhsT *lhs_ = nullptr;
757757
const rhsT *rhs_ = nullptr;
758758
outT *out_ = nullptr;
759-
const ReductionOpT reduction_op_;
760-
const BatchIndexerT batch_indexer_;
761-
const RedIndexerT reduced_dims_indexer_;
759+
ReductionOpT reduction_op_;
760+
BatchIndexerT batch_indexer_;
761+
RedIndexerT reduced_dims_indexer_;
762762
SlmT local_mem_;
763763
std::size_t reduction_max_gid_ = 0;
764764
std::size_t batches_ = 1;

dpctl/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,10 @@ class GemmBatchFunctorThreadK
538538
std::size_t n_wi = 0;
539539
std::size_t m = 0;
540540
std::size_t batch_nelems = 0;
541-
const BatchDimsIndexerT batch_indexer;
542-
const OuterInnerDimsIndexerT lhs_indexer;
543-
const OuterInnerDimsIndexerT rhs_indexer;
544-
const OuterInnerDimsIndexerT res_indexer;
541+
BatchDimsIndexerT batch_indexer;
542+
OuterInnerDimsIndexerT lhs_indexer;
543+
OuterInnerDimsIndexerT rhs_indexer;
544+
OuterInnerDimsIndexerT res_indexer;
545545

546546
public:
547547
GemmBatchFunctorThreadK(const lhsT *lhs_,
@@ -907,10 +907,10 @@ class GemmBatchFunctorThreadNM_vecm
907907
std::uint32_t wg_delta_n = 0;
908908
std::uint32_t wg_delta_m = 0;
909909
std::uint32_t wi_delta_k = 0;
910-
const BatchDimsIndexerT batch_indexer;
911-
const LhsIndexerT lhs_indexer;
912-
const RhsIndexerT rhs_indexer;
913-
const ResIndexerT res_indexer;
910+
BatchDimsIndexerT batch_indexer;
911+
LhsIndexerT lhs_indexer;
912+
RhsIndexerT rhs_indexer;
913+
ResIndexerT res_indexer;
914914

915915
public:
916916
/*! @brief */
@@ -1803,10 +1803,10 @@ class GemmBatchNoAtomicFunctorThreadNM
18031803
std::size_t m_blocks = 0;
18041804
std::size_t wg_delta_m = 0;
18051805
std::size_t batch_nelems;
1806-
const BatchDimsIndexerT batch_indexer;
1807-
const OuterInnerDimsIndexerT lhs_indexer;
1808-
const OuterInnerDimsIndexerT rhs_indexer;
1809-
const ResIndexerT res_indexer;
1806+
BatchDimsIndexerT batch_indexer;
1807+
OuterInnerDimsIndexerT lhs_indexer;
1808+
OuterInnerDimsIndexerT rhs_indexer;
1809+
ResIndexerT res_indexer;
18101810

18111811
public:
18121812
GemmBatchNoAtomicFunctorThreadNM(const lhsT *lhs_,
@@ -2006,10 +2006,10 @@ class GemmBatchNoAtomicFunctorThreadK
20062006
std::size_t n_wi = 0;
20072007
std::size_t m = 0;
20082008
std::size_t batch_nelems = 0;
2009-
const BatchDimsIndexerT batch_indexer;
2010-
const OuterInnerDimsIndexerT lhs_indexer;
2011-
const OuterInnerDimsIndexerT rhs_indexer;
2012-
const ResIndexerT res_indexer;
2009+
BatchDimsIndexerT batch_indexer;
2010+
OuterInnerDimsIndexerT lhs_indexer;
2011+
OuterInnerDimsIndexerT rhs_indexer;
2012+
ResIndexerT res_indexer;
20132013

20142014
public:
20152015
GemmBatchNoAtomicFunctorThreadK(const lhsT *lhs_,

0 commit comments

Comments
 (0)