Skip to content

Commit 6ab5c33

Browse files
committed
build separate cpu and cuda images
1 parent 39d463b commit 6ab5c33

File tree

16 files changed

+116
-93
lines changed

16 files changed

+116
-93
lines changed

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,16 @@ install:
112112
- conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes
113113
- source script/torch.sh
114114
- pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${IDX}.html
115-
- pip install flake8 codecov
115+
- pip install flake8
116+
- pip install codecov
116117
- pip install scipy==1.4.1
117-
- source script/install.sh
118+
- travis_wait 30 pip install -e .
118119
script:
119120
- flake8 .
120121
- python setup.py test
121122
after_success:
122-
- python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}
123-
- python script/rename_wheel.py ${IDX}
123+
- python setup.py bdist_wheel --dist-dir=dist
124+
- ls -lah dist/
124125
- codecov
125126
deploy:
126127
provider: s3
@@ -129,8 +130,8 @@ deploy:
129130
access_key_id: ${S3_ACCESS_KEY}
130131
secret_access_key: ${S3_SECRET_ACCESS_KEY}
131132
bucket: pytorch-geometric.com
132-
local_dir: dist/torch-${TORCH_VERSION}
133-
upload_dir: whl/torch-${TORCH_VERSION}
133+
local_dir: dist
134+
upload_dir: whl/torch-${TORCH_VERSION}+${IDX}
134135
acl: public_read
135136
on:
136137
all_branches: true

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0)
22
project(torchsparse)
33
set(CMAKE_CXX_STANDARD 14)
4-
set(TORCHSPARSE_VERSION 0.6.8)
4+
set(TORCHSPARSE_VERSION 0.6.9)
55

66
option(WITH_CUDA "Enable CUDA support" OFF)
77

csrc/convert.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#endif
99

1010
#ifdef _WIN32
11-
PyMODINIT_FUNC PyInit__convert(void) { return NULL; }
11+
#ifdef WITH_CUDA
12+
PyMODINIT_FUNC PyInit__convert_cuda(void) { return NULL; }
13+
#else
14+
PyMODINIT_FUNC PyInit__convert_cpu(void) { return NULL; }
15+
#endif
1216
#endif
1317

1418
torch::Tensor ind2ptr(torch::Tensor ind, int64_t M) {

csrc/diag.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#endif
99

1010
#ifdef _WIN32
11-
PyMODINIT_FUNC PyInit__diag(void) { return NULL; }
11+
#ifdef WITH_CUDA
12+
PyMODINIT_FUNC PyInit__diag_cuda(void) { return NULL; }
13+
#else
14+
PyMODINIT_FUNC PyInit__diag_cpu(void) { return NULL; }
15+
#endif
1216
#endif
1317

1418
torch::Tensor non_diag_mask(torch::Tensor row, torch::Tensor col, int64_t M,

csrc/metis.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include "cpu/metis_cpu.h"
55

66
#ifdef _WIN32
7-
PyMODINIT_FUNC PyInit__metis(void) { return NULL; }
7+
#ifdef WITH_CUDA
8+
PyMODINIT_FUNC PyInit__metis_cuda(void) { return NULL; }
9+
#else
10+
PyMODINIT_FUNC PyInit__metis_cpu(void) { return NULL; }
11+
#endif
812
#endif
913

1014
torch::Tensor partition(torch::Tensor rowptr, torch::Tensor col,

csrc/relabel.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include "cpu/relabel_cpu.h"
55

66
#ifdef _WIN32
7-
PyMODINIT_FUNC PyInit__relabel(void) { return NULL; }
7+
#ifdef WITH_CUDA
8+
PyMODINIT_FUNC PyInit__relablel_cuda(void) { return NULL; }
9+
#else
10+
PyMODINIT_FUNC PyInit__relabel_cpu(void) { return NULL; }
11+
#endif
812
#endif
913

1014
std::tuple<torch::Tensor, torch::Tensor> relabel(torch::Tensor col,

csrc/rw.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#endif
99

1010
#ifdef _WIN32
11-
PyMODINIT_FUNC PyInit__rw(void) { return NULL; }
11+
#ifdef WITH_CUDA
12+
PyMODINIT_FUNC PyInit__rw_cuda(void) { return NULL; }
13+
#else
14+
PyMODINIT_FUNC PyInit__rw_cpu(void) { return NULL; }
15+
#endif
1216
#endif
1317

1418
torch::Tensor random_walk(torch::Tensor rowptr, torch::Tensor col,

csrc/saint.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include "cpu/saint_cpu.h"
55

66
#ifdef _WIN32
7-
PyMODINIT_FUNC PyInit__saint(void) { return NULL; }
7+
#ifdef WITH_CUDA
8+
PyMODINIT_FUNC PyInit__saint_cuda(void) { return NULL; }
9+
#else
10+
PyMODINIT_FUNC PyInit__saint_cpu(void) { return NULL; }
11+
#endif
812
#endif
913

1014
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>

csrc/sample.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include "cpu/sample_cpu.h"
55

66
#ifdef _WIN32
7-
PyMODINIT_FUNC PyInit__sample(void) { return NULL; }
7+
#ifdef WITH_CUDA
8+
PyMODINIT_FUNC PyInit__sample_cuda(void) { return NULL; }
9+
#else
10+
PyMODINIT_FUNC PyInit__sample_cpu(void) { return NULL; }
11+
#endif
812
#endif
913

1014
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor>

csrc/spmm.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#endif
99

1010
#ifdef _WIN32
11-
PyMODINIT_FUNC PyInit__spmm(void) { return NULL; }
11+
#ifdef WITH_CUDA
12+
PyMODINIT_FUNC PyInit__spmm_cuda(void) { return NULL; }
13+
#else
14+
PyMODINIT_FUNC PyInit__spmm_cpu(void) { return NULL; }
15+
#endif
1216
#endif
1317

1418
std::tuple<torch::Tensor, torch::optional<torch::Tensor>>

0 commit comments

Comments
 (0)