-
Notifications
You must be signed in to change notification settings - Fork 112
/
compile_pointnet_tfops.sh
32 lines (22 loc) · 1.17 KB
/
compile_pointnet_tfops.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
CUDA_INCLUDE=' -I/usr/local/cuda/include/'
CUDA_LIB=' -L/usr/local/cuda/lib64/'
TF_CFLAGS=$(python3 -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))')
TF_LFLAGS=$(python3 -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))')
cd pointnet2/tf_ops/sampling
nvcc -std=c++11 -c -o tf_sampling_g.cu.o tf_sampling_g.cu \
${CUDA_INCLUDE} ${TF_CFLAGS} -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
g++ -std=c++11 -shared -o tf_sampling_so.so tf_sampling.cpp \
tf_sampling_g.cu.o ${CUDA_INCLUDE} ${TF_CFLAGS} -fPIC -lcudart ${TF_LFLAGS} ${CUDA_LIB}
echo 'testing sampling'
python3 tf_sampling.py
cd ../grouping
nvcc -std=c++11 -c -o tf_grouping_g.cu.o tf_grouping_g.cu \
${CUDA_INCLUDE} ${TF_CFLAGS} -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
g++ -std=c++11 -shared -o tf_grouping_so.so tf_grouping.cpp \
tf_grouping_g.cu.o ${CUDA_INCLUDE} ${TF_CFLAGS} -fPIC -lcudart ${TF_LFLAGS} ${CUDA_LIB}
echo 'testing grouping'
python3 tf_grouping_op_test.py
cd ../3d_interpolation
g++ -std=c++11 tf_interpolate.cpp -o tf_interpolate_so.so -shared -fPIC -shared -fPIC ${TF_CFLAGS} ${TF_LFLAGS} -O2
echo 'testing interpolate'
python3 tf_interpolate_op_test.py