mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
* roc: add decoder to ci * also add installer * use CEnum syntax * try 2 * add to setup * revert ci change * the other enum too
21 lines
885 B
Python
Executable File
21 lines
885 B
Python
Executable File
#!/usr/bin/env python3
|
|
import os, shutil
|
|
from pathlib import Path
|
|
from tinygrad.helpers import fetch, OSX
|
|
|
|
DEST = Path("/usr/local/lib")
|
|
DEST.mkdir(exist_ok=True)
|
|
|
|
if __name__ == "__main__":
|
|
if OSX:
|
|
fp = fetch("https://github.com/ROCm/rocprof-trace-decoder/releases/download/0.1.4/rocprof-trace-decoder-macos-arm64-0.1.4-Darwin.sh")
|
|
lib = fp.parent/"rocprof-trace-decoder-macos-arm64-0.1.4-Darwin"/"lib"/"librocprof-trace-decoder.dylib"
|
|
os.chmod(fp, 0o755)
|
|
os.system(f"sudo {fp} --prefix={fp.parent} --include-subdir")
|
|
shutil.copy2(lib, DEST)
|
|
else:
|
|
lib = DEST/"librocprof-trace-decoder.so"
|
|
os.system("sudo curl -L https://github.com/ROCm/rocprof-trace-decoder/raw/43bf0fef74a83c3c25badfc5a09c0bd39ed8c6f9/releases/linux_glibc_2_28_x86_64/librocprof-trace-decoder.so -o"+str(lib))
|
|
os.system("sudo ldconfig")
|
|
print(f"Installed {lib.name} to", DEST)
|