PyTorchEMD/setup.py

26 lines
630 B
Python
Raw Normal View History

2019-09-10 08:05:04 +00:00
"""Setup extension
Notes:
If extra_compile_args is provided, you need to provide different instances for different extensions.
Refer to https://github.com/pytorch/pytorch/issues/20169
"""
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
setup(
2023-04-24 09:45:30 +00:00
name="emd_ext",
2019-09-10 08:05:04 +00:00
ext_modules=[
CUDAExtension(
2023-04-24 09:45:30 +00:00
name="emd_cuda",
2019-09-10 08:05:04 +00:00
sources=[
2023-04-24 09:45:30 +00:00
"cuda/emd.cpp",
"cuda/emd_kernel.cu",
2019-09-10 08:05:04 +00:00
],
2023-04-24 09:45:30 +00:00
extra_compile_args={"cxx": ["-g"], "nvcc": ["-O2"]},
2019-09-10 08:05:04 +00:00
),
],
2023-04-24 09:45:30 +00:00
cmdclass={"build_ext": BuildExtension},
)