Skip to content

Commit 0b9019d

Browse files
committed
fixed windows build
1 parent bccaa10 commit 0b9019d

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

csrc/convert.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <Python.h>
12
#include <torch/script.h>
23

34
#include "cpu/convert_cpu.h"
@@ -6,6 +7,10 @@
67
#include "cuda/convert_cuda.h"
78
#endif
89

10+
#ifdef _WIN32
11+
PyMODINIT_FUNC PyInit__convert(void) { return NULL; }
12+
#endif
13+
914
torch::Tensor ind2ptr(torch::Tensor ind, int64_t M) {
1015
if (ind.device().is_cuda()) {
1116
#ifdef WITH_CUDA

csrc/diag.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <Python.h>
12
#include <torch/script.h>
23

34
#include "cpu/diag_cpu.h"
@@ -6,6 +7,10 @@
67
#include "cuda/diag_cuda.h"
78
#endif
89

10+
#ifdef _WIN32
11+
PyMODINIT_FUNC PyInit__diag(void) { return NULL; }
12+
#endif
13+
914
torch::Tensor non_diag_mask(torch::Tensor row, torch::Tensor col, int64_t M,
1015
int64_t N, int64_t k) {
1116
if (row.device().is_cuda()) {

csrc/spmm.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <Python.h>
12
#include <torch/script.h>
23

34
#include "cpu/spmm_cpu.h"
@@ -6,6 +7,10 @@
67
#include "cuda/spmm_cuda.h"
78
#endif
89

10+
#ifdef _WIN32
11+
PyMODINIT_FUNC PyInit__spmm(void) { return NULL; }
12+
#endif
13+
914
std::tuple<torch::Tensor, torch::optional<torch::Tensor>>
1015
spmm_fw(torch::Tensor rowptr, torch::Tensor col,
1116
torch::optional<torch::Tensor> optional_value, torch::Tensor mat,

csrc/spspmm.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <Python.h>
12
#include <torch/script.h>
23

34
#include "cpu/spspmm_cpu.h"
@@ -6,6 +7,10 @@
67
#include "cuda/spspmm_cuda.h"
78
#endif
89

10+
#ifdef _WIN32
11+
PyMODINIT_FUNC PyInit__spspmm(void) { return NULL; }
12+
#endif
13+
914
std::tuple<torch::Tensor, torch::Tensor, torch::optional<torch::Tensor>>
1015
spspmm_sum(torch::Tensor rowptrA, torch::Tensor colA,
1116
torch::optional<torch::Tensor> optional_valueA,

0 commit comments

Comments
 (0)