Skip to content

Commit b9bc629

Browse files
committed
Move default barrier implementation to KernelIntrinsics
1 parent 8ef29ea commit b9bc629

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/KernelAbstractions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ function SharedMemory(t::Type{T}, dims::Val{Dims}, id::Val{Id}) where {T, Dims,
819819
end
820820

821821
function __synchronize()
822-
error("@synchronize used outside kernel or not captured")
822+
KernelIntrinsics.barrier()
823823
end
824824

825825
@generated function __print(items...)

src/intrinsics.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ Returns the unique group ID.
5252
function get_group_id end
5353

5454
function localmemory end
55-
function barrier end
55+
function barrier()
56+
error("Group barrier used outside kernel or not captured")
57+
end
5658
function print end
5759

5860
end

0 commit comments

Comments
 (0)