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
dgl
Commits
0e188b61
Unverified
Commit
0e188b61
authored
Dec 14, 2023
by
czkkkkkk
Committed by
GitHub
Dec 14, 2023
Browse files
[Sparse] Fix Windows.h dependency issue (#6741)
parent
643a42fe
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
36 additions
and
24 deletions
+36
-24
dgl_sparse/include/sparse/sddmm.h
dgl_sparse/include/sparse/sddmm.h
+0
-1
dgl_sparse/include/sparse/sparse_format.h
dgl_sparse/include/sparse/sparse_format.h
+1
-3
dgl_sparse/include/sparse/sparse_matrix.h
dgl_sparse/include/sparse/sparse_matrix.h
+1
-2
dgl_sparse/include/sparse/spmm.h
dgl_sparse/include/sparse/spmm.h
+0
-1
dgl_sparse/include/sparse/spspmm.h
dgl_sparse/include/sparse/spspmm.h
+0
-1
dgl_sparse/include/sparse/torch_headers.h
dgl_sparse/include/sparse/torch_headers.h
+30
-0
dgl_sparse/src/elemenwise_op.cc
dgl_sparse/src/elemenwise_op.cc
+0
-1
dgl_sparse/src/matmul.cc
dgl_sparse/src/matmul.cc
+1
-1
dgl_sparse/src/matmul.h
dgl_sparse/src/matmul.h
+0
-1
dgl_sparse/src/matrix_ops.cc
dgl_sparse/src/matrix_ops.cc
+0
-1
dgl_sparse/src/python_binding.cc
dgl_sparse/src/python_binding.cc
+1
-2
dgl_sparse/src/reduction.cc
dgl_sparse/src/reduction.cc
+1
-1
dgl_sparse/src/sddmm.cc
dgl_sparse/src/sddmm.cc
+0
-1
dgl_sparse/src/softmax.cc
dgl_sparse/src/softmax.cc
+0
-1
dgl_sparse/src/sparse_matrix.cc
dgl_sparse/src/sparse_matrix.cc
+0
-2
dgl_sparse/src/spmm.cc
dgl_sparse/src/spmm.cc
+0
-1
dgl_sparse/src/spspmm.cc
dgl_sparse/src/spspmm.cc
+0
-1
dgl_sparse/src/utils.h
dgl_sparse/src/utils.h
+1
-3
No files found.
dgl_sparse/include/sparse/sddmm.h
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#define SPARSE_SDDMM_H_
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
namespace
dgl
{
namespace
sparse
{
...
...
dgl_sparse/include/sparse/sparse_format.h
View file @
0e188b61
...
...
@@ -8,11 +8,9 @@
// clang-format off
#include <sparse/dgl_headers.h>
#include <sparse/torch_headers.h>
// clang-format on
#include <torch/custom_class.h>
#include <torch/script.h>
#include <memory>
#include <utility>
...
...
dgl_sparse/include/sparse/sparse_matrix.h
View file @
0e188b61
...
...
@@ -8,11 +8,10 @@
// clang-format off
#include <sparse/dgl_headers.h>
#include <sparse/torch_headers.h>
// clang-format on
#include <sparse/sparse_format.h>
#include <torch/custom_class.h>
#include <torch/script.h>
#include <memory>
#include <tuple>
...
...
dgl_sparse/include/sparse/spmm.h
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#define SPARSE_SPMM_H_
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
namespace
dgl
{
namespace
sparse
{
...
...
dgl_sparse/include/sparse/spspmm.h
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#define SPARSE_SPSPMM_H_
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
namespace
dgl
{
namespace
sparse
{
...
...
dgl_sparse/include/sparse/torch_headers.h
0 → 100644
View file @
0e188b61
/**
* Copyright (c) 2022 by Contributors
* @file sparse/torch_headers.h
* @brief Pytorch headers used in the sparse library. Since Pytorch 2.1.0
* introduced a dependency on <windows.h>, we need to define NOMINMAX to avoid
* the conflict with std::min/std::max macros before including Pytorch headers.
* See more in
* https://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c.
*/
#ifndef SPARSE_TORCH_HEADERS_H_
#define SPARSE_TORCH_HEADERS_H_
#ifdef _WIN32
#ifndef NOMINMAX
#define SPARSE_TORCH_HEADERS_H_NOMINMAX
#define NOMINMAX
#endif // NOMINMAX
#endif // _WIN32
#include <ATen/DLConvertor.h>
#include <c10/util/Logging.h>
#include <torch/custom_class.h>
#include <torch/script.h>
#ifdef SPARSE_TORCH_HEADERS_H_NOMINMAX
#undef NOMINMAX
#endif // SPARSE_TORCH_HEADERS_H_NOMINMAX
#endif // SPARSE_TORCH_HEADERS_H_
dgl_sparse/src/elemenwise_op.cc
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#include <sparse/elementwise_op.h>
#include <sparse/matrix_ops.h>
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
#include <memory>
...
...
dgl_sparse/src/matmul.cc
View file @
0e188b61
...
...
@@ -7,10 +7,10 @@
// clang-format off
#include <sparse/dgl_headers.h>
#include <sparse/torch_headers.h>
// clang-format on
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
#include "./utils.h"
...
...
dgl_sparse/src/matmul.h
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#define DGL_SPARSE_MATMUL_H_
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
#include <string>
...
...
dgl_sparse/src/matrix_ops.cc
View file @
0e188b61
...
...
@@ -4,7 +4,6 @@
* @brief DGL C++ matrix operators.
*/
#include <sparse/matrix_ops.h>
#include <torch/script.h>
namespace
dgl
{
namespace
sparse
{
...
...
dgl_sparse/src/python_binding.cc
View file @
0e188b61
...
...
@@ -5,6 +5,7 @@
*/
// clang-format off
#include <sparse/dgl_headers.h>
#include <sparse/torch_headers.h>
// clang-format on
#include <sparse/elementwise_op.h>
...
...
@@ -15,8 +16,6 @@
#include <sparse/sparse_matrix.h>
#include <sparse/spmm.h>
#include <sparse/spspmm.h>
#include <torch/custom_class.h>
#include <torch/script.h>
namespace
dgl
{
namespace
sparse
{
...
...
dgl_sparse/src/reduction.cc
View file @
0e188b61
...
...
@@ -5,12 +5,12 @@
*/
// clang-format off
#include <sparse/dgl_headers.h>
#include <sparse/torch_headers.h>
// clang-format on
#include <sparse/elementwise_op.h>
#include <sparse/reduction.h>
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
#include <string>
#include <vector>
...
...
dgl_sparse/src/sddmm.cc
View file @
0e188b61
...
...
@@ -5,7 +5,6 @@
*/
#include <sparse/sparse_matrix.h>
#include <sparse/spmm.h>
#include <torch/script.h>
#include <sstream>
...
...
dgl_sparse/src/softmax.cc
View file @
0e188b61
...
...
@@ -6,7 +6,6 @@
#include <sparse/reduction.h>
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
#include "./matmul.h"
#include "./utils.h"
...
...
dgl_sparse/src/sparse_matrix.cc
View file @
0e188b61
...
...
@@ -7,10 +7,8 @@
#include <sparse/dgl_headers.h>
// clang-format on
#include <c10/util/Logging.h>
#include <sparse/elementwise_op.h>
#include <sparse/sparse_matrix.h>
#include <torch/script.h>
#include "./utils.h"
...
...
dgl_sparse/src/spmm.cc
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#include <sparse/sddmm.h>
#include <sparse/sparse_matrix.h>
#include <sparse/spmm.h>
#include <torch/script.h>
#include <sstream>
...
...
dgl_sparse/src/spspmm.cc
View file @
0e188b61
...
...
@@ -7,7 +7,6 @@
#include <sparse/sddmm.h>
#include <sparse/sparse_matrix.h>
#include <sparse/spspmm.h>
#include <torch/script.h>
#include "./matmul.h"
#include "./utils.h"
...
...
dgl_sparse/src/utils.h
View file @
0e188b61
...
...
@@ -8,12 +8,10 @@
// clang-format off
#include <sparse/dgl_headers.h>
#include <sparse/torch_headers.h>
// clang-format on
#include <ATen/DLConvertor.h>
#include <sparse/sparse_matrix.h>
#include <torch/custom_class.h>
#include <torch/script.h>
namespace
dgl
{
namespace
sparse
{
...
...
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