Skip to content

Commit

Permalink
Attempt to fix overloaded bar (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
preda committed Dec 23, 2024
1 parent e52572e commit 002f686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cl/base.cl
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ T2 U2(T a, T b) { return (T2) (a, b); }
#endif
#endif

OVERLOAD void bar() {
void OVERLOAD bar(void) {
// barrier(CLK_LOCAL_MEM_FENCE) is correct, but it turns out that on some GPUs
// (in particular on Radeon VII and Radeon PRO VII) barrier(0) works as well and is faster.
// So allow selecting the faster path when it works with -use FAST_BARRIER
Expand All @@ -183,7 +183,7 @@ OVERLOAD void bar() {
#endif
}

OVERLOAD void bar(u32 WG) { if (WG > WAVEFRONT) { bar(); } }
void OVERLOAD bar(u32 WG) { if (WG > WAVEFRONT) { bar(); } }

// A half-barrier is only needed when half-a-workgroup needs a barrier.
// This is used e.g. by the double-wide tailSquare, where LDS is split between the halves.
Expand Down
4 changes: 2 additions & 2 deletions src/cl/math.cl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "base.cl"

// a * (b + 1) == a * b + a
OVERLOAD T fancyMul(T a, T b) { return fma(a, b, a); }
OVERLOAD T2 fancyMul(T2 a, T2 b) { return U2(fancyMul(a.x, b.x), fancyMul(a.y, b.y)); }
T OVERLOAD fancyMul(T a, T b) { return fma(a, b, a); }
T2 OVERLOAD fancyMul(T2 a, T2 b) { return U2(fancyMul(a.x, b.x), fancyMul(a.y, b.y)); }

T2 cmul(T2 a, T2 b) {
#if 1
Expand Down

0 comments on commit 002f686

Please sign in to comment.