add cstyle renderer to the NULL device (#11709)

Co-authored-by: b1tg <b1tg@users.noreply.github.com>
This commit is contained in:
b1tg
2025-08-19 00:52:22 +08:00
committed by GitHub
parent 18db8fa311
commit 61884f2057

View File

@@ -1,12 +1,11 @@
from tinygrad.device import Compiled, Compiler, Renderer, Allocator
from tinygrad.uop.ops import Ops
from tinygrad.device import Compiled, Compiler, Allocator
from tinygrad.engine.jit import MultiGraphRunner
from tinygrad.renderer.cstyle import CStyleLanguage
class NullRenderer(Renderer):
class NullRenderer(CStyleLanguage):
device = "NULL"
code_for_op = {k:lambda:None for k in [Ops.EXP2, Ops.LOG2, Ops.SIN, Ops.SQRT]}
has_local = False
def render(self, uops:list) -> str: return ""
float4 = "float4"
class NullProgram:
def __init__(self, name:str, lib:bytes): pass