build.sh 437 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
#!/bin/sh

rusty1s's avatar
rusty1s committed
3
4
echo "Compiling kernel..."

rusty1s's avatar
rusty1s committed
5
if [ -z "$1" ]; then TORCH=$(python -c "import os; import torch; print(os.path.dirname(torch.__file__))"); else TORCH="$1"; fi
rusty1s's avatar
rusty1s committed
6
7
SRC_DIR=torch_cluster/kernel
BUILD_DIR=torch_cluster/build
rusty1s's avatar
rusty1s committed
8
9

mkdir -p $BUILD_DIR
rusty1s's avatar
rusty1s committed
10
11
12
for i in serial grid; do
  $(which nvcc) -c -o "$BUILD_DIR/$i.so" "$SRC_DIR/$i.cu" -arch=sm_35 -Xcompiler -fPIC -shared "-I$TORCH/lib/include/TH" "-I$TORCH/lib/include/THC" "-I$SRC_DIR"
done