HIP: All HIP tests now run on CMake's current AMD hardware

This commit is contained in:
Robert Maynard
2020-10-26 21:10:18 +00:00
committed by Zack Galbreath
parent 2e86e50c2f
commit 20d086f1a2
6 changed files with 6 additions and 0 deletions

View File

@@ -10,3 +10,4 @@ target_compile_features(InterfaceWithHIP INTERFACE cxx_std_11)
add_executable(HIPInferHipLang1 )
target_link_libraries(HIPInferHipLang1 PRIVATE InterfaceWithHIP)
set_property(TARGET HIPInferHipLang1 PROPERTY HIP_ARCHITECTURES gfx900)

View File

@@ -7,6 +7,7 @@ add_library(InterfaceWithHIP OBJECT)
target_sources(InterfaceWithHIP PRIVATE interface.hip main.cxx)
target_compile_features(InterfaceWithHIP INTERFACE hip_std_14)
target_compile_features(InterfaceWithHIP INTERFACE cxx_std_11)
set_property(TARGET InterfaceWithHIP PROPERTY HIP_ARCHITECTURES gfx900)
add_executable(HIPInferHipLang2 )
target_link_libraries(HIPInferHipLang2 PRIVATE InterfaceWithHIP)

View File

@@ -13,6 +13,7 @@ project(MathFunctions HIP)
# 3. This makes sure CMake properly links to all the built-in libraries
# that hip needs that inject support for __half support
#
set(CMAKE_HIP_ARCHITECTURES "gfx900")
add_executable(HIPOnlyMathFunctions main.hip)
target_compile_options(HIPOnlyMathFunctions PRIVATE -Werror)
target_compile_features(HIPOnlyMathFunctions PRIVATE hip_std_14)

View File

@@ -3,6 +3,7 @@ project (MixedLanguage C CXX HIP)
set(CMAKE_HIP_STANDARD 14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_HIP_ARCHITECTURES "gfx900")
#Goal for this example:
#make sure that we can build multiple languages into targets

View File

@@ -4,6 +4,7 @@ project (TryCompile HIP)
#Goal for this example:
# Verify try_compile with HIP language works
set(CMAKE_HIP_STANDARD 14)
set(CMAKE_HIP_ARCHITECTURES gfx803 gfx900)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
try_compile(result "${CMAKE_CURRENT_BINARY_DIR}"

View File

@@ -17,6 +17,7 @@ target_compile_features(HIPOnlyWithDefs PRIVATE hip_std_17)
target_compile_options(HIPOnlyWithDefs
PRIVATE
--offload-arch=gfx900
-DFLAG_COMPILE_LANG_$<COMPILE_LANGUAGE>
$<$<HIP_COMPILER_ID:ROCMClang>:-DFLAG_LANG_IS_HIP=$<COMPILE_LANGUAGE:HIP>> # Host-only defines are possible only on NVCC.
)