File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
offload/unittests/OffloadAPI/device_code Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ macro(add_offload_test_device_code test_filename test_name)
7
7
add_custom_command (OUTPUT ${BIN_PATH}
8
8
COMMAND
9
9
${CMAKE_C_COMPILER} --target=nvptx64-nvidia-cuda
10
+ ${ARGN}
10
11
-march=${LIBOMPTARGET_DEP_CUDA_ARCH}
11
12
--cuda-path=${CUDA_ROOT}
12
13
${SRC_PATH} -o ${BIN_PATH}
@@ -21,6 +22,7 @@ macro(add_offload_test_device_code test_filename test_name)
21
22
add_custom_command (OUTPUT ${BIN_PATH}
22
23
COMMAND
23
24
${CMAKE_C_COMPILER} --target=amdgcn-amd-amdhsa -nogpulib
25
+ ${ARGN}
24
26
-mcpu=${LIBOMPTARGET_DEP_AMDGPU_ARCH}
25
27
${SRC_PATH} -o ${BIN_PATH}
26
28
DEPENDS ${SRC_PATH}
@@ -61,7 +63,9 @@ endif()
61
63
62
64
add_offload_test_device_code (foo.c foo )
63
65
add_offload_test_device_code (bar.c bar )
64
- add_offload_test_device_code (noargs.c noargs )
66
+ # By default, amdhsa will add a number of "hidden" arguments to the kernel defintion
67
+ # O3 disables this, and results in a kernel function with actually no arguments as seen by liboffload
68
+ add_offload_test_device_code (noargs.c noargs -O3 )
65
69
66
70
add_custom_target (OffloadUnitTestsDeviceBins DEPENDS ${BIN_PATHS} )
67
71
You can’t perform that action at this time.
0 commit comments