applegpu everywhere

This commit is contained in:
George Hotz
2023-02-27 22:54:59 -08:00
parent d584bae5c0
commit 262f81d795
2 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ pandecode.dump
vertex.bin
recognize*
.idea
applegpu

View File

@@ -4,7 +4,7 @@ import numpy as np
from typing import List, Any
from tinygrad.ops import GlobalCounters
from tinygrad.helpers import prod, getenv, DEBUG
import subprocess
import subprocess, pathlib
METAL_XCODE = getenv("METAL_XCODE")
@@ -67,9 +67,9 @@ class CLProgram:
assert err is None, str(err)
_, err = arc.serializeToURL_error_(Cocoa.NSURL.URLWithString_("file:///tmp/shader.bin"), None)
assert err is None, str(err)
# https://github.com/dougallj/applegpu.git
# clone https://github.com/dougallj/applegpu.git in the root of tinygrad
import os
os.system("cd /Users/kafka/fun/m1/applegpu && python3 compiler_explorer.py /tmp/shader.bin")
os.system(f"cd {pathlib.Path(__file__).parent.parent.parent}/applegpu && python3 compiler_explorer.py /tmp/shader.bin")
self.pipeline_state, err = device.newComputePipelineStateWithFunction_error_(self.fxn, None)
assert err is None, str(err)