Skip to content

Commit c6fa71c

Browse files
authored
[libc][NFC] Add -Wno-multi-gpu everywhere for the GPU build (#83173)
Summary: This warning is intended to indicate if `-march=native` returns different values in a single compilation sense. As it stands we don't care and it absolutely spams the test output if you run it on a machine with more than one GPU like any cluster machine. Disable these warnings everywhere we compile.
1 parent 5e31e82 commit c6fa71c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libc/cmake/modules/LLVMLibCCompileOptionRules.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ function(_get_common_compile_options output_var flags)
8787
list(APPEND compile_options "-fvisibility=hidden")
8888
list(APPEND compile_options "-fconvergent-functions")
8989
list(APPEND compile_options "-flto")
90+
list(APPEND compile_options "-Wno-multi-gpu")
9091

9192
if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
9293
list(APPEND compile_options "-Wno-unknown-cuda-version")

libc/cmake/modules/LLVMLibCTestRules.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,15 @@ function(add_integration_test test_name)
463463

464464
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
465465
target_link_options(${fq_build_target_name} PRIVATE
466-
${LIBC_COMPILE_OPTIONS_DEFAULT}
466+
${LIBC_COMPILE_OPTIONS_DEFAULT} -Wno-multi-gpu
467467
-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto
468468
"-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" -nostdlib -static
469469
"-Wl,-mllvm,-amdhsa-code-object-version=${LIBC_GPU_CODE_OBJECT_VERSION}")
470470
elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
471471
# We need to use the internal object versions for NVPTX.
472472
set(internal_suffix ".__internal__")
473473
target_link_options(${fq_build_target_name} PRIVATE
474-
${LIBC_COMPILE_OPTIONS_DEFAULT}
474+
${LIBC_COMPILE_OPTIONS_DEFAULT} -Wno-multi-gpu
475475
"-Wl,--suppress-stack-size-warning"
476476
-march=${LIBC_GPU_TARGET_ARCHITECTURE} -nostdlib -static
477477
"--cuda-path=${LIBC_CUDA_ROOT}")
@@ -647,14 +647,14 @@ function(add_libc_hermetic_test test_name)
647647
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
648648
target_link_options(${fq_build_target_name} PRIVATE
649649
${LIBC_COMPILE_OPTIONS_DEFAULT}
650-
-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto
650+
-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto -Wno-multi-gpu
651651
"-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" -nostdlib -static
652652
"-Wl,-mllvm,-amdhsa-code-object-version=${LIBC_GPU_CODE_OBJECT_VERSION}")
653653
elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
654654
# We need to use the internal object versions for NVPTX.
655655
set(internal_suffix ".__internal__")
656656
target_link_options(${fq_build_target_name} PRIVATE
657-
${LIBC_COMPILE_OPTIONS_DEFAULT}
657+
${LIBC_COMPILE_OPTIONS_DEFAULT} -Wno-multi-gpu
658658
"-Wl,--suppress-stack-size-warning"
659659
-march=${LIBC_GPU_TARGET_ARCHITECTURE} -nostdlib -static
660660
"--cuda-path=${LIBC_CUDA_ROOT}")

0 commit comments

Comments
 (0)