Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove const qualifiers for class/struct members per C++ guidelines #1975

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ struct MaskedExtractStridedFunctor
const dataT *src = nullptr;
const indT *cumsum = nullptr;
dataT *dst = nullptr;
const std::size_t masked_nelems = 0;
std::size_t masked_nelems = 0;
// has nd, shape, src_strides, dst_strides for
// dimensions that ARE NOT masked
const OrthogIndexerT orthog_src_dst_indexer;
OrthogIndexerT orthog_src_dst_indexer;
// has nd, shape, src_strides for
// dimensions that ARE masked
const MaskedSrcIndexerT masked_src_indexer;
MaskedSrcIndexerT masked_src_indexer;
// has 1, dst_strides for dimensions that ARE masked
const MaskedDstIndexerT masked_dst_indexer;
MaskedDstIndexerT masked_dst_indexer;
LocalAccessorT lacc;
};

Expand Down Expand Up @@ -198,15 +198,15 @@ struct MaskedPlaceStridedFunctor
dataT *dst = nullptr;
const indT *cumsum = nullptr;
const dataT *rhs = nullptr;
const std::size_t masked_nelems = 0;
std::size_t masked_nelems = 0;
// has nd, shape, dst_strides, rhs_strides for
// dimensions that ARE NOT masked
const OrthogIndexerT orthog_dst_rhs_indexer;
OrthogIndexerT orthog_dst_rhs_indexer;
// has nd, shape, dst_strides for
// dimensions that ARE masked
const MaskedDstIndexerT masked_dst_indexer;
MaskedDstIndexerT masked_dst_indexer;
// has 1, rhs_strides for dimensions that ARE masked
const MaskedRhsIndexerT masked_rhs_indexer;
MaskedRhsIndexerT masked_rhs_indexer;
LocalAccessorT lacc;
};

Expand Down
2 changes: 1 addition & 1 deletion dpctl/tensor/libtensor/include/kernels/clip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ template <typename T, typename IndexerT> class ClipStridedFunctor
const T *min_p = nullptr;
const T *max_p = nullptr;
T *dst_p = nullptr;
const IndexerT indexer;
IndexerT indexer;

public:
ClipStridedFunctor(const T *x_p_,
Expand Down
4 changes: 2 additions & 2 deletions dpctl/tensor/libtensor/include/kernels/constructors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ template <typename Ty, typename IndexerT> class FullStridedFunctor
{
private:
Ty *p = nullptr;
const Ty fill_v;
const IndexerT indexer;
Ty fill_v;
IndexerT indexer;

public:
FullStridedFunctor(Ty *p_, const Ty &fill_v_, const IndexerT &indexer_)
Expand Down
16 changes: 8 additions & 8 deletions dpctl/tensor/libtensor/include/kernels/copy_and_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class GenericCopyFunctor
private:
const srcT *src_ = nullptr;
dstT *dst_ = nullptr;
const IndexerT indexer_;
IndexerT indexer_;

public:
GenericCopyFunctor(const srcT *src_p, dstT *dst_p, const IndexerT &indexer)
Expand Down Expand Up @@ -219,7 +219,7 @@ template <typename srcT,
class ContigCopyFunctor
{
private:
const std::size_t nelems;
std::size_t nelems;
const srcT *src_p = nullptr;
dstT *dst_p = nullptr;

Expand Down Expand Up @@ -524,9 +524,9 @@ template <typename AccessorT,
class GenericCopyFromHostFunctor
{
private:
const AccessorT src_acc_;
AccessorT src_acc_;
dstTy *dst_ = nullptr;
const IndexerT indexer_;
IndexerT indexer_;

public:
GenericCopyFromHostFunctor(const AccessorT &src_acc,
Expand Down Expand Up @@ -771,8 +771,8 @@ class GenericCopyForReshapeFunctor
private:
const Ty *src_p = nullptr;
Ty *dst_p = nullptr;
const SrcIndexerT src_indexer_;
const DstIndexerT dst_indexer_;
SrcIndexerT src_indexer_;
DstIndexerT dst_indexer_;

public:
GenericCopyForReshapeFunctor(const char *src_ptr,
Expand Down Expand Up @@ -963,8 +963,8 @@ class StridedCopyForRollFunctor
private:
const Ty *src_p = nullptr;
Ty *dst_p = nullptr;
const SrcIndexerT src_indexer_;
const DstIndexerT dst_indexer_;
SrcIndexerT src_indexer_;
DstIndexerT dst_indexer_;

public:
StridedCopyForRollFunctor(const Ty *src_ptr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template <typename T,
class CopyAsCContigFunctor
{
private:
const std::size_t nelems;
std::size_t nelems;
const T *src_p = nullptr;
T *dst_p = nullptr;
IndexerT src_indexer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct UnaryContigFunctor
private:
const argT *in = nullptr;
resT *out = nullptr;
const std::size_t nelems_;
std::size_t nelems_;

public:
UnaryContigFunctor(const argT *inp, resT *res, const std::size_t n_elems)
Expand Down Expand Up @@ -245,7 +245,7 @@ struct UnaryStridedFunctor
private:
const argT *inp_ = nullptr;
resT *res_ = nullptr;
const IndexerT inp_out_indexer_;
IndexerT inp_out_indexer_;

public:
UnaryStridedFunctor(const argT *inp_p,
Expand Down Expand Up @@ -397,7 +397,7 @@ struct BinaryContigFunctor
const argT1 *in1 = nullptr;
const argT2 *in2 = nullptr;
resT *out = nullptr;
const std::size_t nelems_;
std::size_t nelems_;

public:
BinaryContigFunctor(const argT1 *inp1,
Expand Down Expand Up @@ -529,7 +529,7 @@ struct BinaryStridedFunctor
const argT1 *in1 = nullptr;
const argT2 *in2 = nullptr;
resT *out = nullptr;
const ThreeOffsets_IndexerT three_offsets_indexer_;
ThreeOffsets_IndexerT three_offsets_indexer_;

public:
BinaryStridedFunctor(const argT1 *inp1_tp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct BinaryInplaceContigFunctor
private:
const argT *rhs = nullptr;
resT *lhs = nullptr;
const std::size_t nelems_;
std::size_t nelems_;

public:
BinaryInplaceContigFunctor(const argT *rhs_tp,
Expand Down Expand Up @@ -185,7 +185,7 @@ struct BinaryInplaceStridedFunctor
private:
const argT *rhs = nullptr;
resT *lhs = nullptr;
const TwoOffsets_IndexerT two_offsets_indexer_;
TwoOffsets_IndexerT two_offsets_indexer_;

public:
BinaryInplaceStridedFunctor(const argT *rhs_tp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class TakeFunctor
int k_ = 0;
std::size_t ind_nelems_ = 0;
const ssize_t *axes_shape_and_strides_ = nullptr;
const OrthogIndexer orthog_strider;
const IndicesIndexer ind_strider;
const AxesIndexer axes_strider;
OrthogIndexer orthog_strider;
IndicesIndexer ind_strider;
AxesIndexer axes_strider;

public:
TakeFunctor(const char *src_cp,
Expand Down Expand Up @@ -207,9 +207,9 @@ class PutFunctor
int k_ = 0;
std::size_t ind_nelems_ = 0;
const ssize_t *axes_shape_and_strides_ = nullptr;
const OrthogIndexer orthog_strider;
const IndicesIndexer ind_strider;
const AxesIndexer axes_strider;
OrthogIndexer orthog_strider;
IndicesIndexer ind_strider;
AxesIndexer axes_strider;

public:
PutFunctor(char *dst_cp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ struct DotProductFunctor
const lhsT *lhs_ = nullptr;
const rhsT *rhs_ = nullptr;
outT *out_ = nullptr;
const ReductionOpT reduction_op_;
const BatchIndexerT batch_indexer_;
const RedIndexerT reduced_dims_indexer_;
ReductionOpT reduction_op_;
BatchIndexerT batch_indexer_;
RedIndexerT reduced_dims_indexer_;
std::size_t reduction_max_gid_ = 0;
std::size_t batches_ = 1;
std::size_t reductions_per_wi = 16;
Expand Down Expand Up @@ -211,9 +211,9 @@ struct DotProductCustomFunctor
const lhsT *lhs_ = nullptr;
const rhsT *rhs_ = nullptr;
outT *out_ = nullptr;
const ReductionOpT reduction_op_;
const BatchIndexerT batch_indexer_;
const RedIndexerT reduced_dims_indexer_;
ReductionOpT reduction_op_;
BatchIndexerT batch_indexer_;
RedIndexerT reduced_dims_indexer_;
SlmT local_mem_;
std::size_t reduction_max_gid_ = 0;
std::size_t batches_ = 1;
Expand Down Expand Up @@ -657,9 +657,9 @@ struct DotProductNoAtomicFunctor
const lhsT *lhs_ = nullptr;
const rhsT *rhs_ = nullptr;
outT *out_ = nullptr;
const ReductionOpT reduction_op_;
const BatchIndexerT batch_indexer_;
const RedIndexerT reduced_dims_indexer_;
ReductionOpT reduction_op_;
BatchIndexerT batch_indexer_;
RedIndexerT reduced_dims_indexer_;
std::size_t reduction_max_gid_ = 0;
std::size_t batches_ = 1;
std::size_t reductions_per_wi = 16;
Expand Down Expand Up @@ -756,9 +756,9 @@ struct DotProductNoAtomicCustomFunctor
const lhsT *lhs_ = nullptr;
const rhsT *rhs_ = nullptr;
outT *out_ = nullptr;
const ReductionOpT reduction_op_;
const BatchIndexerT batch_indexer_;
const RedIndexerT reduced_dims_indexer_;
ReductionOpT reduction_op_;
BatchIndexerT batch_indexer_;
RedIndexerT reduced_dims_indexer_;
SlmT local_mem_;
std::size_t reduction_max_gid_ = 0;
std::size_t batches_ = 1;
Expand Down
32 changes: 16 additions & 16 deletions dpctl/tensor/libtensor/include/kernels/linalg_functions/gemm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ class GemmBatchFunctorThreadK
std::size_t n_wi = 0;
std::size_t m = 0;
std::size_t batch_nelems = 0;
const BatchDimsIndexerT batch_indexer;
const OuterInnerDimsIndexerT lhs_indexer;
const OuterInnerDimsIndexerT rhs_indexer;
const OuterInnerDimsIndexerT res_indexer;
BatchDimsIndexerT batch_indexer;
OuterInnerDimsIndexerT lhs_indexer;
OuterInnerDimsIndexerT rhs_indexer;
OuterInnerDimsIndexerT res_indexer;

public:
GemmBatchFunctorThreadK(const lhsT *lhs_,
Expand Down Expand Up @@ -907,10 +907,10 @@ class GemmBatchFunctorThreadNM_vecm
std::uint32_t wg_delta_n = 0;
std::uint32_t wg_delta_m = 0;
std::uint32_t wi_delta_k = 0;
const BatchDimsIndexerT batch_indexer;
const LhsIndexerT lhs_indexer;
const RhsIndexerT rhs_indexer;
const ResIndexerT res_indexer;
BatchDimsIndexerT batch_indexer;
LhsIndexerT lhs_indexer;
RhsIndexerT rhs_indexer;
ResIndexerT res_indexer;

public:
/*! @brief */
Expand Down Expand Up @@ -1803,10 +1803,10 @@ class GemmBatchNoAtomicFunctorThreadNM
std::size_t m_blocks = 0;
std::size_t wg_delta_m = 0;
std::size_t batch_nelems;
const BatchDimsIndexerT batch_indexer;
const OuterInnerDimsIndexerT lhs_indexer;
const OuterInnerDimsIndexerT rhs_indexer;
const ResIndexerT res_indexer;
BatchDimsIndexerT batch_indexer;
OuterInnerDimsIndexerT lhs_indexer;
OuterInnerDimsIndexerT rhs_indexer;
ResIndexerT res_indexer;

public:
GemmBatchNoAtomicFunctorThreadNM(const lhsT *lhs_,
Expand Down Expand Up @@ -2006,10 +2006,10 @@ class GemmBatchNoAtomicFunctorThreadK
std::size_t n_wi = 0;
std::size_t m = 0;
std::size_t batch_nelems = 0;
const BatchDimsIndexerT batch_indexer;
const OuterInnerDimsIndexerT lhs_indexer;
const OuterInnerDimsIndexerT rhs_indexer;
const ResIndexerT res_indexer;
BatchDimsIndexerT batch_indexer;
OuterInnerDimsIndexerT lhs_indexer;
OuterInnerDimsIndexerT rhs_indexer;
ResIndexerT res_indexer;

public:
GemmBatchNoAtomicFunctorThreadK(const lhsT *lhs_,
Expand Down
Loading
Loading