Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-cluster
Commits
89f69c8d
Commit
89f69c8d
authored
Mar 14, 2018
by
rusty1s
Browse files
fixed kernel build
parent
c483a663
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
build.py
build.py
+3
-3
build.sh
build.sh
+2
-2
No files found.
build.py
View file @
89f69c8d
import
os
import
os
.path
as
osp
import
shutil
import
shutil
import
subprocess
import
subprocess
import
torch
import
torch
from
torch.utils.ffi
import
create_extension
from
torch.utils.ffi
import
create_extension
if
os
.
path
.
exists
(
'build'
):
if
os
p
.
exists
(
'build'
):
shutil
.
rmtree
(
'build'
)
shutil
.
rmtree
(
'build'
)
headers
=
[
'torch_cluster/src/cpu.h'
]
headers
=
[
'torch_cluster/src/cpu.h'
]
...
@@ -16,7 +16,7 @@ extra_objects = []
...
@@ -16,7 +16,7 @@ extra_objects = []
with_cuda
=
False
with_cuda
=
False
if
torch
.
cuda
.
is_available
():
if
torch
.
cuda
.
is_available
():
subprocess
.
call
(
'./build.sh'
)
subprocess
.
call
(
[
'./build.sh'
,
osp
.
dirname
(
torch
.
__file__
)]
)
headers
+=
[
'torch_cluster/src/cuda.h'
]
headers
+=
[
'torch_cluster/src/cuda.h'
]
sources
+=
[
'torch_cluster/src/cuda.c'
]
sources
+=
[
'torch_cluster/src/cuda.c'
]
...
...
build.sh
View file @
89f69c8d
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
echo
"Compiling kernel..."
echo
"Compiling kernel..."
TORCH
=
$(
python
-c
"import os; import torch; print(os.path.dirname(torch.__file__))"
)
if
[
-z
"
$1
"
]
;
then
TORCH
=
$(
python
-c
"import os; import torch; print(os.path.dirname(torch.__file__))"
)
;
else
TORCH
=
"
$1
"
;
fi
SRC_DIR
=
torch_cluster/kernel
SRC_DIR
=
torch_cluster/kernel
BUILD_DIR
=
torch_cluster/build
BUILD_DIR
=
torch_cluster/build
mkdir
-p
$BUILD_DIR
mkdir
-p
$BUILD_DIR
$(
which nvcc
)
-c
-o
$BUILD_DIR
/kernel.so
$SRC_DIR
/kernel.cu
-arch
=
sm_35
-Xcompiler
-fPIC
-shared
-I
$
TORCH
/lib/include/TH
-I
$TORCH
/lib/include/THC
-I
$SRC_DIR
$(
which nvcc
)
-c
-o
"
$BUILD_DIR
/kernel.so
"
"
$SRC_DIR
/kernel.cu
"
-arch
=
sm_35
-Xcompiler
-fPIC
-shared
"
-I
$
1
/lib/include/TH
"
"-I
$1
/lib/include/THC
"
"
-I
$SRC_DIR
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment