Skip to content

Commit

Permalink
[ESIMD][E2E][NFC] Replace some of constexpr operations with regular (#…
Browse files Browse the repository at this point in the history
…12277)

This is done to avoid problems with those types that may have issues
with constexpr operations/constructors/etc.

Signed-off-by: Klochkov, Vyacheslav N <vyacheslav.n.klochkov@intel.com>
  • Loading branch information
v-klochkov authored Jan 3, 2024
1 parent 8c92df9 commit 53ab58a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,16 +395,19 @@ template <class T, int N, class C, C Op> struct ImplLoadBase {
template <class T, int N, class C, C Op> struct ImplStoreBase {
static constexpr C atomic_op = Op;
static constexpr int n_args = 1;
static constexpr T base = (T)(2 + FPDELTA);

static T init(int i) { return 0; }

static T gold(int i, bool use_mask) {
T base = (T)(2 + FPDELTA);
T gold = is_updated(i, N, use_mask) ? base : init(i);
return gold;
}

static T arg0(int i) { return base; }
static T arg0(int i) {
T base = (T)(2 + FPDELTA);
return base;
}
};

template <class T, int N, class C, C Op> struct ImplAdd {
Expand All @@ -426,13 +429,14 @@ template <class T, int N, class C, C Op> struct ImplAdd {
template <class T, int N, class C, C Op> struct ImplSub {
static constexpr C atomic_op = Op;
static constexpr int n_args = 1;
static constexpr T base = (T)(5 + FPDELTA);

static T init(int i) {
T base = (T)(5 + FPDELTA);
return (T)(repeat * threads_per_group * n_groups * (T)(1 + FPDELTA) + base);
}

static T gold(int i, bool use_mask) {
T base = (T)(5 + FPDELTA);
T gold = is_updated(i, N, use_mask) ? base : init(i);
return gold;
}
Expand Down

0 comments on commit 53ab58a

Please sign in to comment.