代码拉取完成,页面将自动刷新
同步操作将从 Ascend/mxDriving 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import glob
import os
import subprocess
from pathlib import Path
from typing import Union
import torch
from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension
from utils import extension
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
VERSION = torch.__version__
full_components = ["common", "preprocess", "fused", "point", "detection", "spconv"]
source_file = glob.glob(os.path.join("./bind/", "*.cpp"))
include_dirs = [os.path.join(BASE_DIR, "include")]
for part in full_components:
source_file += glob.glob(os.path.join(f"./mx_driving/{part}/ops/csrc/", "*.cpp"))
exts = []
ext1 = extension.NpuExtension(
name="ads_c",
sources=source_file,
include_dirs=include_dirs,
extra_compile_args=[
'-D__FILENAME__="$$(notdir $$(abspath $$<))"',
"-fprofile-arcs",
"-ftest-coverage",
"-fPIC",
"-fstack-protector-all",
],
extra_link_args=[
"-Wl,-z,relro",
"-Wl,-z,now",
"-s"
],
libraries=["gcov"],
)
exts.append(ext1)
def get_sha(pytorch_root: Union[str, Path]) -> str:
try:
return (
subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=pytorch_root).decode("ascii").strip() # Compliant
)
except Exception:
return "Unknown"
VERSION = "1.0.0"
ads_root = Path(__file__).parent
sha = get_sha(ads_root)
if not os.getenv("BUILD_WITHOUT_SHA"):
VERSION += "+git" + sha[:7]
setup(
name="mx_driving",
version=VERSION,
description="A Library of acceleration for autonomous driving systems on Ascend-NPU.",
keywords="mx_driving",
ext_modules=exts,
author="Ascend Contributors",
cmdclass={"build_ext": BuildExtension},
packages=find_packages(),
include_package_data=True,
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。