Skip to content

Commit a102225

Browse files
author
Salinas, David
authored
[offload] - Add mainline build support for gf950 (llvm#1244)
2 parents 2a99bfa + 90cab32 commit a102225

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

offload/hostexec/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,29 @@ else()
126126
return()
127127
endif()
128128

129+
set(amdgpu_mcpus gfx700 gfx701 gfx801 gfx803 gfx900 gfx902 gfx906 gfx908 gfx90a gfx90c gfx940 gfx941 gfx942 gfx950 gfx1010 gfx1030 gfx1031 gfx1032 gfx1033 gfx1034 gfx1035 gfx1036 gfx1100 gfx1101 gfx1102 gfx1103 gfx1150 gfx1151 gfx1152 gfx1153 gfx1200 gfx1201)
130+
if (DEFINED LIBOMPTARGET_AMDGCN_GFXLIST)
131+
set(amdgpu_mcpus ${LIBOMPTARGET_AMDGCN_GFXLIST})
132+
endif()
133+
134+
set(all_capabilities 35 37 50 52 53 60 61 62 70 72 75 80 86 89 90)
135+
set(LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES ${all_capabilities} CACHE STRING
136+
"List of CUDA Compute Capabilities to be used to compile the NVPTX DeviceRTL.")
137+
string(TOLOWER ${LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES} LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES)
138+
if (LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES STREQUAL "all")
139+
set(nvptx_sm_list ${all_capabilities})
140+
elseif(LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES STREQUAL "auto")
141+
if (NOT LIBOMPTARGET_DEP_CUDA_FOUND)
142+
libomptarget_error_say("[NVPTX] Cannot auto detect compute capability as CUDA not found.")
143+
endif()
144+
set(nvptx_sm_list ${LIBOMPTARGET_DEP_CUDA_ARCH})
145+
else()
146+
string(REPLACE "," ";" nvptx_sm_list "${LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES}")
147+
endif()
148+
foreach(sm ${nvptx_sm_list})
149+
list(APPEND nvptx_mcpus "sm_${sm}")
150+
endforeach()
151+
129152
set(ocl_atomics_cl_filename ${CMAKE_CURRENT_SOURCE_DIR}/src/oclAtomics.cl)
130153
set(invoke_cpp_file_name ${CMAKE_CURRENT_SOURCE_DIR}/src/hostexec_invoke.cpp)
131154
set(hostexec_stubs_filename ${CMAKE_CURRENT_SOURCE_DIR}/src/hostexec_stubs.cpp)

offload/test/lit.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ elif config.libomptarget_current_target.startswith('amdgcn'):
134134
# only check the first one assuming that we will run the test on it.
135135
if not (config.amdgpu_test_arch.startswith("gfx90a") or
136136
config.amdgpu_test_arch.startswith("gfx940") or
137-
config.amdgpu_test_arch.startswith("gfx942")):
137+
config.amdgpu_test_arch.startswith("gfx942") or
138+
config.amdgpu_test_arch.startswith("gfx950")):
138139
supports_unified_shared_memory = False
139140
# check if AMD architecture is an APU:
140141
if (config.amdgpu_test_arch.startswith("gfx940") or

0 commit comments

Comments
 (0)