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-sparse
Commits
2da6195d
Unverified
Commit
2da6195d
authored
Mar 22, 2022
by
Matthias Fey
Committed by
GitHub
Mar 22, 2022
Browse files
CMake fixes (#213)
* cmake fixes * update * update * update * update * reset
parent
66e70ae4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
24 deletions
+27
-24
CMakeLists.txt
CMakeLists.txt
+1
-1
csrc/extensions.h
csrc/extensions.h
+2
-3
csrc/macros.h
csrc/macros.h
+21
-0
csrc/sparse.h
csrc/sparse.h
+1
-19
csrc/version.cpp
csrc/version.cpp
+2
-1
No files found.
CMakeLists.txt
View file @
2da6195d
...
...
@@ -20,7 +20,7 @@ endif()
find_package
(
Torch REQUIRED
)
file
(
GLOB HEADERS csrc/sparse.h
)
file
(
GLOB OPERATOR_SOURCES csrc/
cpu/
*.
h
csrc/cpu/*.
cpp csrc/*.cpp
)
file
(
GLOB OPERATOR_SOURCES csrc/*.
*
csrc/cpu/*.
*
)
if
(
WITH_CUDA
)
file
(
GLOB OPERATOR_SOURCES
${
OPERATOR_SOURCES
}
csrc/cuda/*.h csrc/cuda/*.cu
)
endif
()
...
...
csrc/extensions.h
View file @
2da6195d
#include <torch/torch.h>
#include "sparse.h"
#include "macros.h"
#include <torch/extension.h>
// for getpid()
#ifdef _WIN32
...
...
csrc/macros.h
0 → 100644
View file @
2da6195d
#pragma once
#ifdef _WIN32
#if defined(torchsparse_EXPORTS)
#define SPARSE_API __declspec(dllexport)
#else
#define SPARSE_API __declspec(dllimport)
#endif
#else
#define SPARSE_API
#endif
#if (defined __cpp_inline_variables) || __cplusplus >= 201703L
#define SPARSE_INLINE_VARIABLE inline
#else
#ifdef _MSC_VER
#define SPARSE_INLINE_VARIABLE __declspec(selectany)
#else
#define SPARSE_INLINE_VARIABLE __attribute__((weak))
#endif
#endif
csrc/sparse.h
View file @
2da6195d
...
...
@@ -2,25 +2,7 @@
#include <torch/extension.h>
#ifdef _WIN32
#if defined(torchsparse_EXPORTS)
#define SPARSE_API __declspec(dllexport)
#else
#define SPARSE_API __declspec(dllimport)
#endif
#else
#define SPARSE_API
#endif
#if (defined __cpp_inline_variables) || __cplusplus >= 201703L
#define SPARSE_INLINE_VARIABLE inline
#else
#ifdef _MSC_VER
#define SPARSE_INLINE_VARIABLE __declspec(selectany)
#else
#define SPARSE_INLINE_VARIABLE __attribute__((weak))
#endif
#endif
#include "macros.h"
namespace
sparse
{
SPARSE_API
int64_t
cuda_version
()
noexcept
;
...
...
csrc/version.cpp
View file @
2da6195d
#ifdef WITH_PYTHON
#include <Python.h>
#endif
#include "sparse.h"
#include <torch/script.h>
#ifdef WITH_CUDA
#include <cuda.h>
#endif
#include "macros.h"
#ifdef _WIN32
#ifdef WITH_PYTHON
#ifdef WITH_CUDA
...
...
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