Skip to content

Commit a46eea1

Browse files
committed
fix pack .h in whl problem
1 parent ecc1653 commit a46eea1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ def build_cmake(self, ext: CMakeExtension):
7676
cmake_args += ["-DRUNTIME_ENVIRONMENT=maca"]
7777
cmake_args += ["-DBUILD_UCM_SPARSE=OFF"]
7878
case _:
79-
# default ascend
80-
cmake_args += ["-DRUNTIME_ENVIRONMENT=ascend"]
79+
import torch
80+
81+
if hasattr(torch, "cuda") and torch.cuda.is_available():
82+
cmake_args += ["-DRUNTIME_ENVIRONMENT=cuda"]
83+
else:
84+
cmake_args += ["-DRUNTIME_ENVIRONMENT=ascend"]
8185

8286
subprocess.check_call(
8387
["cmake", *cmake_args, ext.cmake_file_path], cwd=build_dir
@@ -103,4 +107,5 @@ def build_cmake(self, ext: CMakeExtension):
103107
ext_modules=[CMakeExtension(name="ucm", source_dir=ROOT_DIR)],
104108
cmdclass={"build_ext": CMakeBuild},
105109
zip_safe=False,
110+
include_package_data=False,
106111
)

0 commit comments

Comments
 (0)