Skip to content

Commit

Permalink
xe: reduction: define atomic functions only when not deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonsays095 authored and karturov committed Nov 5, 2024
1 parent a30d526 commit 32d8660
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/gpu/intel/ocl/reduction/ocl_reduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ IF_DOUBLE_SUPPORTED(DEF_fp_minmax_abs(double));
} \
}

DEF_reduce(float);
DEF_reduce(int);
IF_DOUBLE_SUPPORTED(DEF_reduce(double));
IF_DOUBLE_SUPPORTED(DEF_reduce(half));

#undef DEF_reduce

#if !DETERMINISTIC && ATOMICS_SUPPORTED
// Atomic reduction does not support mul... Must be checked on the caller side
#define DEF_atomic_reduce(dt) \
dt __attribute__((overloadable)) atomic_reduce( \
Expand All @@ -89,20 +97,13 @@ IF_DOUBLE_SUPPORTED(DEF_fp_minmax_abs(double));
return SPECIAL(dt, zero); \
}

DEF_reduce(float);
DEF_reduce(int);
IF_DOUBLE_SUPPORTED(DEF_reduce(double));
IF_DOUBLE_SUPPORTED(DEF_reduce(half));

#if ATOMICS_SUPPORTED
#if ATOMIC_FLOAT_SUPPORTED
DEF_atomic_reduce(float);
#endif
DEF_atomic_reduce(int);
#endif

#undef DEF_reduce
#undef DEF_atomic_reduce
#endif

// ************ Initialization functions ************* //

Expand Down

0 comments on commit 32d8660

Please sign in to comment.