fix gpu compilation of const GEP (#1788)

This commit is contained in:
nimlgen
2023-09-06 17:34:46 +03:00
committed by GitHub
parent e10a9692ec
commit 130cd55942

View File

@@ -199,7 +199,7 @@ def uops_to_cstyle(lang:CStyleLanguage, function_name:str, uops:List[UOp]) -> st
bufs.append(args)
r[u] = args[0]
elif uop == UOps.GEP:
r[u] = f"{r[vin[0]]}.{'xyzw'[args]}"
r[u] = f"({r[vin[0]]}).{'xyzw'[args]}"
else:
raise RuntimeError(f"failed to render {uop}")