Skip to content

Commit f2cf9d4

Browse files
bottlerfacebook-github-bot
authored andcommitted
windows fix
Summary: Attempt to reduce nvcc trouble on windows by (1) avoiding flag for c++14 and (2) avoiding `torch/extension.h`, which introduces pybind11, in `.cu` files. Reviewed By: patricklabatut Differential Revision: D34969868 fbshipit-source-id: f3878d6a2ba9d644e87ae7b6377cb5008b4b6ce3
1 parent e2622d7 commit f2cf9d4

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

pytorch3d/csrc/ball_query/ball_query.cu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <math.h>
1313
#include <stdio.h>
1414
#include <stdlib.h>
15-
#include "utils/pytorch3d_cutils.h"
1615

1716
// A chunk of work is blocksize-many points of P1.
1817
// The number of potential chunks to do is N*(1+(P1-1)/blocksize)

pytorch3d/csrc/iou_box3d/iou_box3d.cu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <thrust/device_vector.h>
1616
#include <thrust/tuple.h>
1717
#include "iou_box3d/iou_utils.cuh"
18-
#include "utils/pytorch3d_cutils.h"
1918

2019
// Parallelize over N*M computations which can each be done
2120
// independently

pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <math.h>
1313
#include <stdio.h>
1414
#include <stdlib.h>
15-
#include "utils/pytorch3d_cutils.h"
1615
#include "utils/warp_reduce.cuh"
1716

1817
template <unsigned int block_size>
@@ -170,6 +169,9 @@ at::Tensor FarthestPointSamplingCuda(
170169
// This will ensure each thread processes the minimum necessary number of
171170
// points (P/threads).
172171
const int points_pow_2 = std::log(static_cast<double>(P)) / std::log(2.0);
172+
173+
// Max possible threads per block
174+
const int MAX_THREADS_PER_BLOCK = 1024;
173175
const size_t threads = max(min(1 << points_pow_2, MAX_THREADS_PER_BLOCK), 1);
174176

175177
// Create the accessors

pytorch3d/csrc/utils/pytorch3d_cutils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@
1515
#define CHECK_CONTIGUOUS_CUDA(x) \
1616
CHECK_CUDA(x); \
1717
CHECK_CONTIGUOUS(x)
18-
19-
// Max possible threads per block
20-
const int MAX_THREADS_PER_BLOCK = 1024;

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ def get_extensions():
5757
define_macros += [("THRUST_IGNORE_CUB_VERSION_CHECK", None)]
5858
cub_home = os.environ.get("CUB_HOME", None)
5959
nvcc_args = [
60-
"-std=c++14",
6160
"-DCUDA_HAS_FP16=1",
6261
"-D__CUDA_NO_HALF_OPERATORS__",
6362
"-D__CUDA_NO_HALF_CONVERSIONS__",
6463
"-D__CUDA_NO_HALF2_OPERATORS__",
6564
]
65+
if os.name != "nt":
66+
nvcc_args.append("-std=c++14")
6667
if cub_home is None:
6768
prefix = os.environ.get("CONDA_PREFIX", None)
6869
if prefix is not None and os.path.isdir(prefix + "/include/cub"):

0 commit comments

Comments
 (0)