-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildscript
executable file
·19 lines (15 loc) · 943 Bytes
/
buildscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
xcrun -sdk macosx metal -o flash.ir -c flash.metal;
xcrun -sdk macosx metallib -o flash.metallib flash.ir;
xcrun -sdk macosx metal -o flashback.ir -c flashback.metal;
xcrun -sdk macosx metallib -o flashback.metallib flashback.ir;
g++ -std=c++17 -O3 -shared -fPIC -DTORCH_EXTENSION_NAME=FlashMetal $(python -m pybind11 --includes) \
driver.cpp \
-I/opt/homebrew/Caskroom/miniforge/base/envs/mlp/lib/python3.8/site-packages/torch/include \
-I/opt/homebrew/Caskroom/miniforge/base/envs/mlp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include \
-I ~/metal-cpp \
-L/opt/homebrew/Caskroom/miniforge/base/envs/mlp/lib/python3.8/site-packages/torch/lib \
-Wl,-rpath,/opt/homebrew/Caskroom/miniforge/base/envs/mlp/lib/python3.8/site-packages/torch/lib \
-lc10 -ltorch -ltorch_cpu -framework Foundation -framework QuartzCore -framework Metal \
-Wl,-undefined,dynamic_lookup \
-o FlashMetal`python3-config --extension-suffix`;
rm *.ir