Skip to content

Commit b77720b

Browse files
Added const qualifiers for functor call operators
1 parent 8fb103d commit b77720b

Some content is hidden

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

61 files changed

+138
-114
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ template <typename argT, typename resT> struct AbsFunctor
6161
using supports_sg_loadstore = typename std::negation<
6262
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6363

64-
resT operator()(const argT &x)
64+
resT operator()(const argT &x) const
6565
{
6666

6767
if constexpr (std::is_same_v<argT, bool> ||

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AcosFunctor
6363
using supports_sg_loadstore = typename std::negation<
6464
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6565

66-
resT operator()(const argT &in)
66+
resT operator()(const argT &in) const
6767
{
6868
if constexpr (is_complex<argT>::value) {
6969
using realT = typename argT::value_type;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AcoshFunctor
6363
using supports_sg_loadstore = typename std::negation<
6464
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6565

66-
resT operator()(const argT &in)
66+
resT operator()(const argT &in) const
6767
{
6868
if constexpr (is_complex<argT>::value) {
6969
using realT = typename argT::value_type;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ template <typename argT1, typename argT2, typename resT> struct AddFunctor
5858
using supports_vec = std::negation<
5959
std::disjunction<tu_ns::is_complex<argT1>, tu_ns::is_complex<argT2>>>;
6060

61-
resT operator()(const argT1 &in1, const argT2 &in2)
61+
resT operator()(const argT1 &in1, const argT2 &in2) const
6262
{
6363
return in1 + in2;
6464
}
6565

6666
template <int vec_sz>
67-
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
68-
const sycl::vec<argT2, vec_sz> &in2)
67+
sycl::vec<resT, vec_sz>
68+
operator()(const sycl::vec<argT1, vec_sz> &in1,
69+
const sycl::vec<argT2, vec_sz> &in2) const
6970
{
7071
auto tmp = in1 + in2;
7172
if constexpr (std::is_same_v<resT,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AsinFunctor
6363
using supports_sg_loadstore = typename std::negation<
6464
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6565

66-
resT operator()(const argT &in)
66+
resT operator()(const argT &in) const
6767
{
6868
if constexpr (is_complex<argT>::value) {
6969
using realT = typename argT::value_type;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AsinhFunctor
6363
using supports_sg_loadstore = typename std::negation<
6464
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6565

66-
resT operator()(const argT &in)
66+
resT operator()(const argT &in) const
6767
{
6868
if constexpr (is_complex<argT>::value) {
6969
using realT = typename argT::value_type;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ template <typename argT, typename resT> struct AtanFunctor
6464
using supports_sg_loadstore = typename std::negation<
6565
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6666

67-
resT operator()(const argT &in)
67+
resT operator()(const argT &in) const
6868
{
6969
if constexpr (is_complex<argT>::value) {
7070
using realT = typename argT::value_type;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ template <typename argT1, typename argT2, typename resT> struct Atan2Functor
5555
using supports_sg_loadstore = std::true_type;
5656
using supports_vec = std::false_type;
5757

58-
resT operator()(const argT1 &in1, const argT2 &in2)
58+
resT operator()(const argT1 &in1, const argT2 &in2) const
5959
{
6060
if (std::isinf(in2) && !std::signbit(in2)) {
6161
if (std::isfinite(in1)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ template <typename argT, typename resT> struct AtanhFunctor
6464
using supports_sg_loadstore = typename std::negation<
6565
std::disjunction<is_complex<resT>, is_complex<argT>>>;
6666

67-
resT operator()(const argT &in)
67+
resT operator()(const argT &in) const
6868
{
6969
if constexpr (is_complex<argT>::value) {
7070
using realT = typename argT::value_type;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct BitwiseAndFunctor
5757
using supports_sg_loadstore = typename std::true_type;
5858
using supports_vec = typename std::true_type;
5959

60-
resT operator()(const argT1 &in1, const argT2 &in2)
60+
resT operator()(const argT1 &in1, const argT2 &in2) const
6161
{
6262
using tu_ns::convert_impl;
6363

@@ -70,8 +70,9 @@ struct BitwiseAndFunctor
7070
}
7171

7272
template <int vec_sz>
73-
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
74-
const sycl::vec<argT2, vec_sz> &in2)
73+
sycl::vec<resT, vec_sz>
74+
operator()(const sycl::vec<argT1, vec_sz> &in1,
75+
const sycl::vec<argT2, vec_sz> &in2) const
7576
{
7677

7778
if constexpr (std::is_same_v<resT, bool>) {

0 commit comments

Comments
 (0)