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
This commit is contained in:
Jeremy Reizenstein
2022-03-24 06:52:05 -07:00
committed by Facebook GitHub Bot
parent e2622d79c0
commit f2cf9d4d0b
5 changed files with 5 additions and 7 deletions

View File

@@ -57,12 +57,13 @@ def get_extensions():
define_macros += [("THRUST_IGNORE_CUB_VERSION_CHECK", None)]
cub_home = os.environ.get("CUB_HOME", None)
nvcc_args = [
"-std=c++14",
"-DCUDA_HAS_FP16=1",
"-D__CUDA_NO_HALF_OPERATORS__",
"-D__CUDA_NO_HALF_CONVERSIONS__",
"-D__CUDA_NO_HALF2_OPERATORS__",
]
if os.name != "nt":
nvcc_args.append("-std=c++14")
if cub_home is None:
prefix = os.environ.get("CONDA_PREFIX", None)
if prefix is not None and os.path.isdir(prefix + "/include/cub"):