Fix cuda errors when running llama example (#749)

This commit is contained in:
Jan Henrik Høiland
2023-04-16 22:52:10 +02:00
committed by GitHub
parent 0b5a0b9ba4
commit 4e17d27d09
2 changed files with 3 additions and 1 deletions

View File

@@ -116,6 +116,8 @@ def uops_to_cstyle(uops:List[UOp], bufs:List[Union[LocalBuffer,LazyBuffer]], lan
assert newvar is not None
if args == -math.inf:
kk(f"{newvar.render(True)} = -INFINITY;")
elif newvar.ltype == LocalTypes.float4:
kk(f"{newvar.render(True)} = {{ {args}f, {args}f, {args}f, {args}f }};")
else:
kk(f"{newvar.render(True)} = {args}f;")
elif uop == UOps.ALU: