Skip to content

Commit

Permalink
Fixing the implementations of FENCE_PRE_OP and FENCE_POST_OP.
Browse files Browse the repository at this point in the history
The OCL’s GPU memory model problem was originally identified and reported by Tyler Sorensen and Jake Kirkham from Princeton University.

Change-Id: Idc15fb39c90d7b53d884deb11aa173a1bf6b1e13
  • Loading branch information
grey-eminence authored and sys_zuul committed Mar 11, 2020
1 parent ce1e52c commit 1c6b78c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IGC/BiFModule/Implementation/atomics.cl
Expand Up @@ -51,13 +51,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define FENCE_PRE_OP(Scope, Semantics) \
if( ( (Semantics) & ( SEMANTICS_PRE_OP_NEED_FENCE ) ) > 0 ) \
{ \
__builtin_spirv_OpMemoryBarrier_i32_i32( (Scope), (Semantics) ); \
__builtin_IB_memfence(true, false, false, false, false, true, false); \
}

#define FENCE_POST_OP(Scope, Semantics) \
if( ( (Semantics) & ( SEMANTICS_POST_OP_NEEDS_FENCE ) ) > 0 ) \
{ \
__builtin_spirv_OpMemoryBarrier_i32_i32( (Scope), (Semantics) ); \
__builtin_IB_memfence(true, false, false, false, false, true, false); \
}

// This fencing scheme allows us to obey the memory model when coherency is
Expand Down

0 comments on commit 1c6b78c

Please sign in to comment.