Skip to content

Commit 2d12b29

Browse files
committed
fixup! define basic intrinsics
1 parent bd15c5e commit 2d12b29

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/KernelAbstractions.jl

+8-1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ function unsafe_free! end
189189

190190
unsafe_free!(::AbstractArray) = return
191191

192+
include("intrinsics.jl")
193+
import .KernelIntrinsics
194+
export KernelIntrinsics
195+
192196
###
193197
# Kernel language
194198
# - @localmem
@@ -455,7 +459,10 @@ end
455459
# Internal kernel functions
456460
###
457461

458-
function __index_Local_Linear end
462+
function __index_Local_Linear(ctx)
463+
KernelIntrinsics.get_local_id().x
464+
end
465+
459466
function __index_Group_Linear end
460467
function __index_Global_Linear end
461468

src/intrinsics.jl

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module KernelIntrinsics
44
get_global_size()::@NamedTuple{x::Int32, y::Int32, z::Int32}
55
66
Return the number of global work-items specified.
7+
8+
!!! note
9+
1-based.
710
"""
811
function get_global_size end
912

0 commit comments

Comments
 (0)