Skip to content

Commit 3f8827e

Browse files
authored
[OpenMP][cmake] Add SPARC support (#142364)
This patch adds SPARC infrastructure to the `openmp` `cmake` files, matching what is done for other architectures. Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`, `sparc-unknown-linux-gnu`, `sparc64-unknown-linux-gnu`, `i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and `x86_64-pc-linux-gnu`.
1 parent 692c5cd commit 3f8827e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

openmp/runtime/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ set(VE FALSE)
190190
set(S390X FALSE)
191191
set(WASM FALSE)
192192
set(PPC FALSE)
193+
set(SPARC FALSE)
194+
set(SPARCV9 FALSE)
193195
if("${LIBOMP_ARCH}" STREQUAL "i386" OR "${LIBOMP_ARCH}" STREQUAL "32") # IA-32 architecture
194196
set(IA32 TRUE)
195197
elseif("${LIBOMP_ARCH}" STREQUAL "x86_64" OR "${LIBOMP_ARCH}" STREQUAL "32e") # Intel(R) 64 architecture
@@ -226,6 +228,10 @@ elseif("${LIBOMP_ARCH}" STREQUAL "s390x") # S390x (Z) architecture
226228
set(S390X TRUE)
227229
elseif("${LIBOMP_ARCH}" STREQUAL "wasm32") # WebAssembly architecture
228230
set(WASM TRUE)
231+
elseif("${LIBOMP_ARCH}" STREQUAL "sparc") # SPARC architecture
232+
set(SPARC TRUE)
233+
elseif("${LIBOMP_ARCH}" STREQUAL "sparcv9") # SPARC V9 architecture
234+
set(SPARCV9 TRUE)
229235
endif()
230236

231237
# Set some flags based on build_type

openmp/runtime/cmake/LibompUtils.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ function(libomp_get_legal_arch return_arch_string)
117117
set(${return_arch_string} "VE" PARENT_SCOPE)
118118
elseif(${S390X})
119119
set(${return_arch_string} "S390X" PARENT_SCOPE)
120+
elseif(${SPARC})
121+
set(${return_arch_string} "SPARC" PARENT_SCOPE)
122+
elseif(${SPARCV9})
123+
set(${return_arch_string} "SPARCV9" PARENT_SCOPE)
120124
else()
121125
set(${return_arch_string} "${LIBOMP_ARCH}" PARENT_SCOPE)
122126
libomp_warning_say("libomp_get_legal_arch(): Warning: Unknown architecture: Using ${LIBOMP_ARCH}")

0 commit comments

Comments
 (0)