forked from tinygrad/tinygrad
hcq2 fix hangs (#17529)
This commit is contained in:
@@ -264,6 +264,7 @@ class ClangRenderer(CStyleLanguage):
|
||||
nan = '__builtin_nanf("")'
|
||||
|
||||
# language options
|
||||
barrier = "__atomic_thread_fence(__ATOMIC_SEQ_CST);"
|
||||
buffer_suffix = " restrict"
|
||||
type_map = {dtypes.bool:"_Bool", dtypes.half:"__fp16"}
|
||||
code_for_op = {**({k:v for k,v in CStyleLanguage.code_for_op.items() if k not in [Ops.EXP2, Ops.SIN, Ops.LOG2, Ops.TRUNC, Ops.RECIPROCAL]}),
|
||||
|
||||
@@ -142,7 +142,7 @@ base_rewrite = PatternMatcher([
|
||||
(UPat(Ops.IF, name="x"), lambda ctx,x: f" br i1 {ctx[x.src[0]]}, label %ifbody_{ctx[x][1:]}, label %ifskip_{ctx[x][1:]}\nifbody_{ctx[x][1:]}:"),
|
||||
(UPat(Ops.ENDIF, name="x"), lambda ctx,x: f" br label %ifskip_{ctx[x.src[0]][1:]}\nifskip_{ctx[x.src[0]][1:]}:"),
|
||||
|
||||
(UPat(Ops.BARRIER), lambda ctx: "")
|
||||
(UPat(Ops.BARRIER), lambda ctx: " fence seq_cst")
|
||||
])
|
||||
|
||||
class LLVMRenderer(Renderer):
|
||||
|
||||
Reference in New Issue
Block a user