1
1
set (TEST_INPUT_BINARIES )
2
2
set (TEST_INPUT_BITCODES )
3
+ set (TEST_INPUT_BUNDLES )
4
+ set (TEST_INPUT_ARCHIVES )
3
5
# Create target ${name} which depends on a clang command to compile ${input} to
4
6
# ${output}, with any additional arguments from ${ARGN}, and add it to the
5
7
# TEST_INPUT_BINARIES target list.
@@ -39,8 +41,9 @@ endmacro()
39
41
macro (add_test_input_bitcode name input output )
40
42
add_custom_command (
41
43
OUTPUT "${output} "
42
- COMMAND "$<TARGET_FILE:clang>" -c --offload-arch=gfx906 -emit-llvm -fgpu-rdc
43
- --gpu-bundle-output ${ARGN} "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
44
+ COMMAND "$<TARGET_FILE:clang>" -c -emit-llvm -target amdgcn-amd-amdhsa
45
+ -mcpu=gfx900
46
+ ${ARGN} "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
44
47
-o "${output} "
45
48
VERBATIM
46
49
DEPENDS clang lld "${input} " )
@@ -50,6 +53,23 @@ macro(add_test_input_bitcode name input output)
50
53
list (APPEND TEST_INPUT_BITCODES "${name} " )
51
54
endmacro ()
52
55
56
+ # Creates target ${name} which depends on a clang command to compile ${input} to
57
+ # ${output}, with any additional arguments from ${ARGN}, and add it to the
58
+ # TEST_INPUT_BUNDLES target list.
59
+ macro (add_test_input_bundle name input output )
60
+ add_custom_command (
61
+ OUTPUT "${output} "
62
+ COMMAND "$<TARGET_FILE:clang>" -c --offload-arch=gfx900 -emit-llvm -fgpu-rdc
63
+ --gpu-bundle-output ${ARGN} "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
64
+ -o "${output} "
65
+ VERBATIM
66
+ DEPENDS clang lld "${input} " )
67
+ add_custom_target ("${name} "
68
+ DEPENDS "${output} "
69
+ SOURCES "${input} " )
70
+ list (APPEND TEST_INPUT_BUNDLES "${name} " )
71
+ endmacro ()
72
+
53
73
# Creates target ${name} and output ${output} by archiving a file.
54
74
# ${target} should refer to the a target created in the above
55
75
# add_test_input_bitcode() macro, and ${input} should refer
@@ -63,7 +83,7 @@ macro(add_test_archive name target input output)
63
83
add_custom_target ("${name} "
64
84
DEPENDS "${output} "
65
85
SOURCES "${input} " )
66
- list (APPEND TEST_INPUT_BITCODES "${name} " )
86
+ list (APPEND TEST_INPUT_ARCHIVES "${name} " )
67
87
endmacro ()
68
88
69
89
add_test_input_binary (reloc1 source /reloc1.cl source /reloc1.o -c -mcode-object-version=4 )
@@ -134,7 +154,8 @@ endif()
134
154
target_link_libraries ("${name} "
135
155
amd_comgr )
136
156
add_dependencies ("${name} "
137
- ${TEST_INPUT_BINARIES} ;${TEST_INPUT_BITCODES} )
157
+ ${TEST_INPUT_BINARIES} ;${TEST_INPUT_BITCODES};${TEST_INPUT_BUNDLES};
158
+ ${TEST_INPUT_ARCHIVES} )
138
159
add_test (NAME ${test_name}
139
160
COMMAND "${name} " )
140
161
add_dependencies (check-comgr ${name} )
@@ -183,9 +204,9 @@ add_comgr_test(map_elf_virtual_address_test c)
183
204
184
205
# Test : Compile HIP tests only if HIP-Clang is installed.
185
206
if (DEFINED HIP_COMPILER AND "${HIP_COMPILER} " STREQUAL "clang" )
186
- add_test_input_bitcode (cube source /cube.hip source /cube.bc )
187
- add_test_input_bitcode (square source /square.hip source /square.bc )
188
- add_test_input_bitcode (double source /double.hip source /double.bc )
207
+ add_test_input_bundle (cube source /cube.hip source /cube.bc )
208
+ add_test_input_bundle (square source /square.hip source /square.bc )
209
+ add_test_input_bundle (double source /double.hip source /double.bc )
189
210
190
211
add_test_archive (cube_archive cube source /cube.bc source /cube.a )
191
212
0 commit comments