未验证 提交 0531a48b 编写于 作者: J jiangcheng 提交者: GitHub

fix CINN should add float16.h may install bug (#49324)

* fix CINN should add float16.h may install bug

* reupdate setuppy support float16

* add only if float16.h file exists
上级 16931039
......@@ -522,6 +522,12 @@ if '${WITH_CINN}' == 'ON':
shutil.copy('${CINN_INCLUDE_DIR}/cinn/runtime/cuda/cinn_cuda_runtime_source.cuh', libs_path)
package_data['paddle.libs']+=['libcinnapi.so']
package_data['paddle.libs']+=['cinn_cuda_runtime_source.cuh']
cinn_fp16_file = '${CINN_INCLUDE_DIR}/cinn/runtime/cuda/float16.h'
if os.path.exists(cinn_fp16_file):
shutil.copy(cinn_fp16_file, libs_path)
package_data['paddle.libs']+=['float16.h']
if '${CMAKE_BUILD_TYPE}' == 'Release' and os.name != 'nt':
command = "patchelf --set-rpath '$ORIGIN/' %s/${CINN_LIB_NAME}" % libs_path
if os.system(command) != 0:
......
......@@ -859,6 +859,14 @@ def get_package_data_and_package_dir():
)
package_data['paddle.libs'] += ['libcinnapi.so']
package_data['paddle.libs'] += ['cinn_cuda_runtime_source.cuh']
cinn_fp16_file = (
env_dict.get("CINN_INCLUDE_DIR") + '/cinn/runtime/cuda/float16.h'
)
if os.path.exists(cinn_fp16_file):
shutil.copy(cinn_fp16_file, libs_path)
package_data['paddle.libs'] += ['float16.h']
if env_dict.get("CMAKE_BUILD_TYPE") == 'Release' and os.name != 'nt':
command = (
"patchelf --set-rpath '$ORIGIN/' %s/" % libs_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册