Skip to content

Commit 8281785

Browse files
committed
fix reassignment of types in RT codegen for aliases
1 parent aacfd26 commit 8281785

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

constantine/math_compiler/experimental/gpu_compiler.nim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ proc codegen*(gen: GpuGenericsInfo, ast: GpuAst, kernel: string = ""): string =
133133
for fn in gen.procs: # assign generics info to correct table
134134
ctx.genericInsts[fn.pName] = fn
135135
for typ in gen.types: # assign generics info to correct table
136-
ctx.types[typ.tTyp] = typ
136+
case typ.kind
137+
of gpuTypeDef:
138+
ctx.types[typ.tTyp] = typ
139+
of gpuAlias:
140+
ctx.types[typ.aTyp] = typ
141+
else: raiseAssert "Unexpected node kind assigning to `types`: " & $typ
137142
result = ctx.codegen(ast, kernel)
138143

139144

0 commit comments

Comments
 (0)