forked from mindspore-Ecosystem/mindspore
gpu/cpu use glibcxx_abi=0
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
parent
4067de1258
commit
f2adc0109b
|
@ -14,7 +14,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/check_requirements.cmake)
|
|||
include(${CMAKE_SOURCE_DIR}/cmake/ascend_variables.cmake)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
if(NOT ENABLE_GLIBCXX)
|
||||
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
|
||||
endif()
|
||||
|
|
|
@ -33,7 +33,7 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||
set(USE_MS_THREADPOOL_FOR_DNNL OFF)
|
||||
endif()
|
||||
|
||||
if(NOT ENABLE_D AND NOT ENABLE_TESTCASES AND NOT ENABLE_ACL)
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(ENABLE_GLIBCXX ON)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -97,12 +97,13 @@ def _compile_aot(file):
|
|||
Custom.compiled_bin.append(func_path)
|
||||
|
||||
if file.endswith("cpp") or file.endswith("cc"):
|
||||
cmd = ["g++", "-std=c++17", "--shared", "-fPIC"]
|
||||
cmd = ["g++", "-std=c++17", "--shared", "-fPIC", "-D_GLIBCXX_USE_CXX11_ABI=0"]
|
||||
cmd += [include_file, "-o", func_path, file]
|
||||
elif file.endswith("cu"):
|
||||
cmd = ["nvcc"]
|
||||
cmd += ["--shared", "-Xcompiler", "-fPIC", "-O3", "-gencode", "arch=compute_70, code=sm_70"]
|
||||
cmd += ["--use_fast_math", "--expt-relaxed-constexpr", "--expt-extended-lambda"]
|
||||
cmd += ["-D_GLIBCXX_USE_CXX11_ABI=0"]
|
||||
|
||||
def _get_cuda_bare_metal_version():
|
||||
raw_output = subprocess.check_output(["nvcc", "-V"],
|
||||
|
|
|
@ -46,16 +46,16 @@ class AOTSingleOutputWithAttrNet(Cell):
|
|||
|
||||
def get_file_path_gpu(cuda, so):
|
||||
dir_path = os.path.dirname(os.path.abspath(__file__))
|
||||
cmd = "nvcc --shared -Xcompiler -fPIC -o " + dir_path + "/aot_test_files/" + so + " " + dir_path + \
|
||||
"/aot_test_files/" + cuda
|
||||
cmd = "nvcc -D_GLIBCXX_USE_CXX11_ABI=0 --shared -Xcompiler -fPIC -o " + dir_path + "/aot_test_files/" + so + \
|
||||
" " + dir_path + "/aot_test_files/" + cuda
|
||||
func_path = dir_path + "/aot_test_files/" + so
|
||||
return cmd, func_path
|
||||
|
||||
|
||||
def get_file_path_cpu(cc, so):
|
||||
dir_path = os.path.dirname(os.path.abspath(__file__))
|
||||
cmd = "g++ -std=c++17 --shared -fPIC -o " + dir_path + "/aot_test_files/" + so + " " + dir_path + \
|
||||
"/aot_test_files/" + cc
|
||||
cmd = "g++ -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 --shared -fPIC -o " + dir_path + "/aot_test_files/" + so + " " + \
|
||||
dir_path + "/aot_test_files/" + cc
|
||||
func_path = dir_path + "/aot_test_files/" + so
|
||||
return cmd, func_path
|
||||
|
||||
|
|
Loading…
Reference in New Issue