Skip to content

[OpenMP][cmake] Add SPARC support #142364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openmp/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ set(VE FALSE)
set(S390X FALSE)
set(WASM FALSE)
set(PPC FALSE)
set(SPARC FALSE)
set(SPARCV9 FALSE)
if("${LIBOMP_ARCH}" STREQUAL "i386" OR "${LIBOMP_ARCH}" STREQUAL "32") # IA-32 architecture
set(IA32 TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "x86_64" OR "${LIBOMP_ARCH}" STREQUAL "32e") # Intel(R) 64 architecture
Expand Down Expand Up @@ -226,6 +228,10 @@ elseif("${LIBOMP_ARCH}" STREQUAL "s390x") # S390x (Z) architecture
set(S390X TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "wasm32") # WebAssembly architecture
set(WASM TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "sparc") # SPARC architecture
set(SPARC TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "sparcv9") # SPARC V9 architecture
set(SPARCV9 TRUE)
endif()

# Set some flags based on build_type
Expand Down
4 changes: 4 additions & 0 deletions openmp/runtime/cmake/LibompUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ function(libomp_get_legal_arch return_arch_string)
set(${return_arch_string} "VE" PARENT_SCOPE)
elseif(${S390X})
set(${return_arch_string} "S390X" PARENT_SCOPE)
elseif(${SPARC})
set(${return_arch_string} "SPARC" PARENT_SCOPE)
elseif(${SPARCV9})
set(${return_arch_string} "SPARCV9" PARENT_SCOPE)
else()
set(${return_arch_string} "${LIBOMP_ARCH}" PARENT_SCOPE)
libomp_warning_say("libomp_get_legal_arch(): Warning: Unknown architecture: Using ${LIBOMP_ARCH}")
Expand Down
Loading