mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
remove try-catches on llvm import (#13883)
This commit is contained in:
committed by
GitHub
parent
9d8397be11
commit
9c6850fc01
@@ -2,8 +2,7 @@ import ctypes, platform, sys, subprocess
|
|||||||
from tinygrad.device import Compiler
|
from tinygrad.device import Compiler
|
||||||
from tinygrad.helpers import OSX, getenv, capstone_flatdump, DEBUG, unwrap
|
from tinygrad.helpers import OSX, getenv, capstone_flatdump, DEBUG, unwrap
|
||||||
from tinygrad.runtime.support.elf import jit_loader
|
from tinygrad.runtime.support.elf import jit_loader
|
||||||
try: from tinygrad.runtime.autogen import llvm
|
from tinygrad.runtime.autogen import llvm
|
||||||
except (ImportError, FileNotFoundError): llvm = None #type:ignore[assignment]
|
|
||||||
|
|
||||||
class ClangJITCompiler(Compiler):
|
class ClangJITCompiler(Compiler):
|
||||||
def __init__(self, cachekey="compile_clang_jit"): super().__init__(cachekey)
|
def __init__(self, cachekey="compile_clang_jit"): super().__init__(cachekey)
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import base64, ctypes, pathlib, tempfile, hashlib, sys
|
import base64, ctypes, pathlib, tempfile, hashlib, sys
|
||||||
from tinygrad.device import Compiler
|
from tinygrad.device import Compiler
|
||||||
from tinygrad.helpers import cpu_objdump, system, data64
|
from tinygrad.helpers import cpu_objdump, system, data64
|
||||||
from tinygrad.runtime.autogen import mesa
|
from tinygrad.runtime.autogen import mesa, llvm
|
||||||
from tinygrad.runtime.support.compiler_cpu import CPULLVMCompiler, expect, cerr
|
from tinygrad.runtime.support.compiler_cpu import CPULLVMCompiler, expect, cerr
|
||||||
try: from tinygrad.runtime.autogen import llvm
|
|
||||||
except (ImportError, FileNotFoundError): llvm = None #type:ignore[assignment]
|
|
||||||
|
|
||||||
# NB: compilers assume mesa's glsl type cache is managed externally with mesa.glsl_type_singleton_init_or_ref() and mesa.glsl_type_singleton_decref()
|
# NB: compilers assume mesa's glsl type cache is managed externally with mesa.glsl_type_singleton_init_or_ref() and mesa.glsl_type_singleton_decref()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user