PVD/metrics/PyTorchEMD/setup.py

26 lines
630 B
Python
Raw Normal View History

2021-10-19 20:54:46 +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-11 09:12:58 +00:00
name="emd_ext",
2021-10-19 20:54:46 +00:00
ext_modules=[
CUDAExtension(
2023-04-11 09:12:58 +00:00
name="emd_cuda",
2021-10-19 20:54:46 +00:00
sources=[
2023-04-11 09:12:58 +00:00
"cuda/emd.cpp",
"cuda/emd_kernel.cu",
2021-10-19 20:54:46 +00:00
],
2023-04-11 09:12:58 +00:00
extra_compile_args={"cxx": ["-g"], "nvcc": ["-O2"]},
2021-10-19 20:54:46 +00:00
),
],
2023-04-11 09:12:58 +00:00
cmdclass={"build_ext": BuildExtension},
)