Skip to content

Commit 1298a56

Browse files
committed
fixup! define basic intrinsics
1 parent 33de8ac commit 1298a56

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
@@ -447,7 +451,10 @@ end
447451
# Internal kernel functions
448452
###
449453

450-
function __index_Local_Linear end
454+
function __index_Local_Linear(ctx)
455+
KernelIntrinsics.get_local_id().x
456+
end
457+
451458
function __index_Group_Linear end
452459
function __index_Global_Linear end
453460

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)