tinygrad runtime.ops_llvm

Note

You likely want the upstream tinygrad, not tinygrab. Tinygrab contains AI generated docstrings for a tinygrad snapshot. Upstream: https://tinygrad.org

class tinygrad.runtime.ops_llvm.LLVM[source]

Bases: object

This class represents the LLVM compiler infrastructure. It provides an interface for compiling and optimizing code.

target_machine

The target machine used for code generation.

Type:

ClassVar[llvm.targets.TargetMachine]

engine

The execution engine used to run the compiled code.

Type:

ClassVar[llvm.executionengine.ExecutionEngine]

optimizer

The module pass manager used to optimize the generated code.

Type:

ClassVar[llvm.passmanagers.ModulePassManager]

engine: ClassVar[ExecutionEngine] = None
optimizer: ClassVar[ModulePassManager] = None
target_machine: ClassVar[TargetMachine] = None
class tinygrad.runtime.ops_llvm.LLVMProgram(name: str, lib: bytes)[source]

Bases: object

Represents a compiled LLVM program.

This class represents a compiled LLVM program that can be executed on the CPU. It contains a name, library, and function address. The class also provides a callable interface for executing the compiled program.

name

The name of the program.

Type:

str

lib

The compiled object file as a byte array.

Type:

bytes

Parameters:
  • name (str) – The name of the program.

  • lib (bytes) – The compiled object file as a byte array.