Skip to content

Commit

Permalink
re-arranged code to be more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyTheSouthernSnowman committed Aug 29, 2023
1 parent d0b9f68 commit f5bd049
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tinygrad/runtime/ops_metal.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# pip3 install pyobjc-framework-Metal pyobjc-framework-Cocoa pyobjc-framework-libdispatch
import os, subprocess, pathlib, functools, ctypes

try:
import os, subprocess, pathlib, functools, ctypes
import Metal, Cocoa, libdispatch # type: ignore
from typing import List, Any
from tinygrad.codegen.linearizer import LinearizerOptions
from tinygrad.renderer.cstyle import uops_to_cstyle, CStyleLanguage
from tinygrad.helpers import prod, getenv, DEBUG, DType, dtypes
from tinygrad.ops import Compiled
from tinygrad.runtime.lib import RawBufferMapped, LRUAllocator
except ImportError as e:
raise ImportError(f"{e.name}. \n If you may want to try:\n\tpip3 install pyobjc-framework-Metal pyobjc-framework-Cocoa pyobjc-framework-libdispatch\n")

from typing import List, Any
from tinygrad.codegen.linearizer import LinearizerOptions
from tinygrad.renderer.cstyle import uops_to_cstyle, CStyleLanguage
from tinygrad.helpers import prod, getenv, DEBUG, DType, dtypes
from tinygrad.ops import Compiled
from tinygrad.runtime.lib import RawBufferMapped, LRUAllocator

METAL_XCODE = getenv("METAL_XCODE")

class MetalAllocator(LRUAllocator):
Expand Down

0 comments on commit f5bd049

Please sign in to comment.