Skip to content

call operator of ProjFunctor must be const #1415

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

Merged
merged 5 commits into from
Sep 22, 2023
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 @@ -61,7 +61,7 @@ template <typename argT, typename resT> struct AbsFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &x)
resT operator()(const argT &x) const
{

if constexpr (std::is_same_v<argT, bool> ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AcosFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AcoshFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ template <typename argT1, typename argT2, typename resT> struct AddFunctor
using supports_vec = std::negation<
std::disjunction<tu_ns::is_complex<argT1>, tu_ns::is_complex<argT2>>>;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
return in1 + in2;
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{
auto tmp = in1 + in2;
if constexpr (std::is_same_v<resT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AsinFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct AsinhFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ template <typename argT, typename resT> struct AtanFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template <typename argT1, typename argT2, typename resT> struct Atan2Functor
using supports_sg_loadstore = std::true_type;
using supports_vec = std::false_type;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
if (std::isinf(in2) && !std::signbit(in2)) {
if (std::isfinite(in1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ template <typename argT, typename resT> struct AtanhFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct BitwiseAndFunctor
using supports_sg_loadstore = typename std::true_type;
using supports_vec = typename std::true_type;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
using tu_ns::convert_impl;

Expand All @@ -70,8 +70,9 @@ struct BitwiseAndFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{

if constexpr (std::is_same_v<resT, bool>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ template <typename argT, typename resT> struct BitwiseInvertFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in)
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in) const
{
if constexpr (std::is_same_v<argT, bool>) {
auto res_vec = !in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ struct BitwiseLeftShiftFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{
sycl::vec<resT, vec_sz> res;
#pragma unroll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ template <typename argT1, typename argT2, typename resT> struct BitwiseOrFunctor
using supports_sg_loadstore = typename std::true_type;
using supports_vec = typename std::true_type;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
using tu_ns::convert_impl;

Expand All @@ -69,8 +69,9 @@ template <typename argT1, typename argT2, typename resT> struct BitwiseOrFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{

if constexpr (std::is_same_v<resT, bool>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct BitwiseXorFunctor
using supports_sg_loadstore = typename std::true_type;
using supports_vec = typename std::true_type;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
if constexpr (std::is_same_v<resT, bool>) {
// (false != false) -> false, (false != true) -> true
Expand All @@ -70,8 +70,9 @@ struct BitwiseXorFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{

if constexpr (std::is_same_v<resT, bool>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct CeilFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (std::is_integral_v<argT>) {
return in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ template <typename argT, typename resT> struct ConjFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
return std::conj(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct CosFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct CoshFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ template <typename argT1, typename argT2, typename resT> struct EqualFunctor
std::negation<std::disjunction<tu_ns::is_complex<argT1>,
tu_ns::is_complex<argT2>>>>;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
return (in1 == in2);
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{
auto tmp = (in1 == in2);
if constexpr (std::is_same_v<resT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ template <typename argT, typename resT> struct ExpFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ template <typename argT, typename resT> struct Expm1Functor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
using realT = typename argT::value_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <typename argT, typename resT> struct FloorFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (std::is_integral_v<argT>) {
return in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct FloorDivideFunctor
using supports_sg_loadstore = std::true_type;
using supports_vec = std::true_type;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
if constexpr (std::is_same_v<argT1, bool> &&
std::is_same_v<argT2, bool>) {
Expand Down Expand Up @@ -83,8 +83,9 @@ struct FloorDivideFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{
if constexpr (std::is_same_v<argT1, bool> &&
std::is_same_v<argT2, bool>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ template <typename argT1, typename argT2, typename resT> struct GreaterFunctor
std::negation<std::disjunction<tu_ns::is_complex<argT1>,
tu_ns::is_complex<argT2>>>>;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
if constexpr (tu_ns::is_complex<argT1>::value ||
tu_ns::is_complex<argT2>::value)
Expand All @@ -77,8 +77,9 @@ template <typename argT1, typename argT2, typename resT> struct GreaterFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{

auto tmp = (in1 > in2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct GreaterEqualFunctor
std::negation<std::disjunction<tu_ns::is_complex<argT1>,
tu_ns::is_complex<argT2>>>>;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
if constexpr (tu_ns::is_complex<argT1>::value ||
tu_ns::is_complex<argT2>::value)
Expand All @@ -78,8 +78,9 @@ struct GreaterEqualFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{

auto tmp = (in1 >= in2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ template <typename argT1, typename argT2, typename resT> struct HypotFunctor
using supports_vec = std::negation<
std::disjunction<tu_ns::is_complex<argT1>, tu_ns::is_complex<argT2>>>;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
return std::hypot(in1, in2);
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{
auto res = sycl::hypot(in1, in2);
if constexpr (std::is_same_v<resT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ template <typename argT, typename resT> struct ImagFunctor
using supports_sg_loadstore = typename std::negation<
std::disjunction<is_complex<resT>, is_complex<argT>>>;

resT operator()(const argT &in)
resT operator()(const argT &in) const
{
if constexpr (is_complex<argT>::value) {
return std::imag(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ template <typename argT, typename resT> struct IsFiniteFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in)
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in) const
{
auto const &res_vec = sycl::isfinite(in);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ template <typename argT, typename resT> struct IsInfFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in)
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in) const
{
auto const &res_vec = sycl::isinf(in);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ template <typename argT, typename resT> struct IsNanFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in)
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in) const
{
auto const &res_vec = sycl::isnan(in);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ template <typename argT1, typename argT2, typename resT> struct LessFunctor
std::negation<std::disjunction<tu_ns::is_complex<argT1>,
tu_ns::is_complex<argT2>>>>;

resT operator()(const argT1 &in1, const argT2 &in2)
resT operator()(const argT1 &in1, const argT2 &in2) const
{
if constexpr (tu_ns::is_complex<argT1>::value ||
tu_ns::is_complex<argT2>::value)
Expand All @@ -76,8 +76,9 @@ template <typename argT1, typename argT2, typename resT> struct LessFunctor
}

template <int vec_sz>
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2)
sycl::vec<resT, vec_sz>
operator()(const sycl::vec<argT1, vec_sz> &in1,
const sycl::vec<argT2, vec_sz> &in2) const
{

auto tmp = (in1 < in2);
Expand Down
Loading