浏览代码

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

Robert Maynard 5 年之前
父节点
当前提交
20d086f1a2

+ 1 - 0
Tests/HIP/InferHipLang1/CMakeLists.txt

@@ -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)

+ 1 - 0
Tests/HIP/InferHipLang2/CMakeLists.txt

@@ -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)

+ 1 - 0
Tests/HIP/MathFunctions/CMakeLists.txt

@@ -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)

+ 1 - 0
Tests/HIP/MixedLanguage/CMakeLists.txt

@@ -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

+ 1 - 0
Tests/HIP/TryCompile/CMakeLists.txt

@@ -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}"

+ 1 - 0
Tests/HIP/WithDefs/CMakeLists.txt

@@ -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.
   )