forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reviewed and Tested-by: Aaron Watry <[email protected]> llvm-svn: 185837
- Loading branch information
1 parent
a4cadba
commit 3a81b5d
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
#include <clc/clc.h> | ||
|
||
void barrier_local(void); | ||
void barrier_global(void); | ||
|
||
void barrier(cl_mem_fence_flags flags) { | ||
if (flags & CLK_LOCAL_MEM_FENCE) { | ||
barrier_local(); | ||
} | ||
|
||
if (flags & CLK_GLOBAL_MEM_FENCE) { | ||
barrier_global(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
declare void @llvm.AMDGPU.barrier.local() nounwind | ||
declare void @llvm.AMDGPU.barrier.global() nounwind | ||
|
||
define void @barrier_local() nounwind alwaysinline { | ||
call void @llvm.AMDGPU.barrier.local() | ||
ret void | ||
} | ||
|
||
define void @barrier_global() nounwind alwaysinline { | ||
call void @llvm.AMDGPU.barrier.global() | ||
ret void | ||
} |