Skip to content

Commit

Permalink
Tried setting workgroup priority
Browse files Browse the repository at this point in the history
I can't say for sure it is any better.  Certainly any benefit is within the margin of error in timings.
Accept the commit or not, it doesn't really matter.
  • Loading branch information
gwoltman committed Jan 13, 2025
1 parent ef39a7d commit 280fc76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cl/carryfused.cl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ KERNEL(G_W) carryFused(P(T2) out, CP(T2) in, u32 posROE, P(i64) carryShuttle, P(

readCarryFusedLine(in, u, line);

#if HAS_ASM
__asm("s_setprio 3");
#endif

// Split 32 bits into NW groups of 2 bits. See later for different way to do this.
#if !BIGLIT
#define GPW (16 / NW)
Expand Down Expand Up @@ -158,10 +162,16 @@ KERNEL(G_W) carryFused(P(T2) out, CP(T2) in, u32 posROE, P(i64) carryShuttle, P(
}
}
if (gr == 0) { return; }
#if HAS_ASM
__asm("s_setprio 0");
#endif
u32 pos = (gr - 1) * (G_W / WAVEFRONT) + me / WAVEFRONT;
if (me % WAVEFRONT == 0) {
do { spin(); } while(atomic_load_explicit((atomic_uint *) &ready[pos], memory_order_relaxed, memory_scope_device) == 0);
}
#if HAS_ASM
__asm("s_setprio 1");
#endif
mem_fence(CLK_GLOBAL_MEM_FENCE);

// Clear carry ready flag for next iteration
Expand Down

0 comments on commit 280fc76

Please sign in to comment.