Skip to content

Commit 6a05bc0

Browse files
committed
[Flang] Stop building multiple verisons of the OpenMP library
Summary: We do not need to build for all of these architectures. Since the infrastructure uses the natively created packager binary we can rely on the support for generic targets. This is the same thing the OpenMP / libc projects use now. Depends on #126655
1 parent 94f9d5d commit 6a05bc0

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

flang/cmake/modules/AddFlangOffloadRuntime.cmake

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,36 +96,14 @@ macro(enable_omp_offload_compilation files)
9696
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND
9797
"${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
9898

99-
set(all_amdgpu_architectures
100-
"gfx700;gfx701;gfx801;gfx803;gfx900;gfx902;gfx906"
101-
"gfx908;gfx90a;gfx90c;gfx940;gfx1010;gfx1030"
102-
"gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036"
103-
"gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151"
104-
"gfx1152;gfx1153"
105-
)
106-
set(all_nvptx_architectures
107-
"sm_35;sm_37;sm_50;sm_52;sm_53;sm_60;sm_61;sm_62"
108-
"sm_70;sm_72;sm_75;sm_80;sm_86;sm_89;sm_90"
109-
)
110-
set(all_gpu_architectures
111-
"${all_amdgpu_architectures};${all_nvptx_architectures}"
112-
)
113-
# TODO: support auto detection on the build system.
114-
if (FLANG_OMP_DEVICE_ARCHITECTURES STREQUAL "all")
115-
set(FLANG_OMP_DEVICE_ARCHITECTURES ${all_gpu_architectures})
116-
endif()
117-
list(REMOVE_DUPLICATES FLANG_OMP_DEVICE_ARCHITECTURES)
118-
119-
string(REPLACE ";" "," compile_for_architectures
120-
"${FLANG_OMP_DEVICE_ARCHITECTURES}"
121-
)
122-
12399
set(OMP_COMPILE_OPTIONS
124100
-fopenmp
125101
-fvisibility=hidden
126102
-fopenmp-cuda-mode
127-
--offload-arch=${compile_for_architectures}
128-
# Force LTO for the device part.
103+
-fopenmp-targets=amdgcn-amd-amdhsa,nvptx64-nvidia-cuda
104+
-Xopenmp-target=amdgcn-amd-amdhsa -march=''
105+
-Xopenmp-target=nvptx64-nvidia-cuda -march=''
106+
-nogpulib
129107
-foffload-lto
130108
)
131109
set_source_files_properties(${files} PROPERTIES COMPILE_OPTIONS

0 commit comments

Comments
 (0)