Tests/HIP/WithDefs: Clean up test case

Fix code copied from equivalent CUDA test.

Drop `CMAKE_HIP_ARCHITECTURES=OFF`.  That is already covered by
a dedicated `HIP.ArchitectureOff` test.
This commit is contained in:
Brad King 2023-08-10 16:05:25 -04:00
parent 9ebdf3281f
commit 90e23f40ee

View File

@ -2,12 +2,11 @@
cmake_minimum_required(VERSION 3.18)
project (WithDefs HIP)
set(CMAKE_HIP_ARCHITECTURES OFF)
set(release_compile_defs DEFREL)
#Goal for this example:
#build a executable that needs to be passed a complex define through add_definitions
#this verifies we can pass C++ style attributes to hipcc
#Build an executable that needs to be passed a complex define through add_definitions.
#Verify we can pass C++ style attributes to the HIP compiler.
add_definitions("-DPACKED_DEFINE=[[gnu::packed]]")
add_executable(HIPOnlyWithDefs main.hip.cpp)
@ -17,9 +16,8 @@ target_compile_features(HIPOnlyWithDefs PRIVATE hip_std_17)
target_compile_options(HIPOnlyWithDefs
PRIVATE
--offload-arch=gfx900
-DFLAG_COMPILE_LANG_$<COMPILE_LANGUAGE>
$<$<HIP_COMPILER_ID:Clang>:-DFLAG_LANG_IS_HIP=$<COMPILE_LANGUAGE:HIP>> # Host-only defines are possible only on NVCC.
-DFLAG_LANG_IS_HIP=$<COMPILE_LANGUAGE:HIP>
)
target_compile_definitions(HIPOnlyWithDefs