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
d9be28c0
Commit
d9be28c0
authored
Mar 30, 2018
by
rusty1s
Browse files
gputest
parent
5d7997a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
benchmark/ffi.py
benchmark/ffi.py
+12
-0
build_new.sh
build_new.sh
+12
-0
No files found.
benchmark/ffi.py
0 → 100644
View file @
d9be28c0
import
torch
from
torch_cluster._ext
import
ffi
cluster
=
torch
.
cuda
.
LongTensor
(
5
)
pos
=
torch
.
cuda
.
FloatTensor
(
5
,
2
)
size
=
torch
.
cuda
.
FloatTensor
(
2
)
count
=
torch
.
cuda
.
LongTensor
(
2
)
func
=
ffi
.
THCCFloatGrid
print
(
func
)
func
(
cluster
,
pos
,
size
,
count
)
build_new.sh
0 → 100755
View file @
d9be28c0
#!/bin/sh
echo
"Compiling kernel..."
if
[
-z
"
$1
"
]
;
then
TORCH
=
$(
python
-c
"import os; import torch; print(os.path.dirname(torch.__file__))"
)
;
else
TORCH
=
"
$1
"
;
fi
SRC_DIR
=
aten/THC
BUILD_DIR
=
aten/build
mkdir
-p
$BUILD_DIR
for
i
in
THCGreedy THCGrid
;
do
$(
which nvcc
)
-c
-o
"
$BUILD_DIR
/
$i
.so"
"
$SRC_DIR
/
$i
.cu"
-arch
=
sm_52
-Xcompiler
-fPIC
-shared
"-I
$TORCH
/lib/include/TH"
"-I
$TORCH
/lib/include"
"-I
$SRC_DIR
"
done
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