diff --git a/python/setup.py.in b/python/setup.py.in index c453dffb3570f90f0e711fd099792abcc220f21f..f22841e2f86826cc6b29b95052efceaa6526faf7 100755 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -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: diff --git a/setup.py b/setup.py index e2e1e9dc2d235685a94ddcb0bb5eafffc4f3b9dd..d801365dd1338cbd5076ff3be729f00d1c7361e6 100644 --- a/setup.py +++ b/setup.py @@ -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