Unverified Commit 2da6195d authored by Matthias Fey's avatar Matthias Fey Committed by GitHub
Browse files

CMake fixes (#213)

* cmake fixes

* update

* update

* update

* update

* reset
parent 66e70ae4
......@@ -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()
......
#include <torch/torch.h>
#include "sparse.h"
#include "macros.h"
#include <torch/extension.h>
// for getpid()
#ifdef _WIN32
......
#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
......@@ -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;
......
#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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment