Skip to content

Commit 9b78c12

Browse files
committed
Thread-local memory without id argument
1 parent 48b807e commit 9b78c12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/device/gcn/memory_static.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@generated function alloc_special(
33
::Val{id}, ::Type{T}, ::Val{as}, ::Val{len}, ::Val{zeroinit} = Val{false}(),
44
) where {id,T,as,len,zeroinit}
5-
@dispose ctx=Context() begin
5+
Context() do ctx
66
eltyp = convert(LLVMType, T)
77

88
# old versions of GPUArrays invoke _shmem with an integer id; make sure those are unique
@@ -24,8 +24,8 @@
2424
gv = GlobalVariable(mod, gv_typ, string(id), as)
2525
if len > 0
2626
if as == AS.Local
27-
linkage!(gv, LLVM.API.LLVMExternalLinkage)
28-
# NOTE: Backend doesn't support initializer for local AS
27+
linkage!(gv, LLVM.API.LLVMInternalLinkage)
28+
initializer!(gv, UndefValue(gv_typ))
2929
elseif as == AS.Private
3030
linkage!(gv, LLVM.API.LLVMInternalLinkage)
3131
initializer!(gv, null(gv_typ))
@@ -38,7 +38,7 @@
3838
alignment!(gv, Base.max(32, Base.datatype_alignment(T)))
3939

4040
# generate IR
41-
@dispose builder=IRBuilder() begin
41+
IRBuilder() do builder
4242
entry = BasicBlock(llvm_f, "entry")
4343
position!(builder, entry)
4444

0 commit comments

Comments
 (0)