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)
77 add_custom_command (OUTPUT ${BIN_PATH}
88 COMMAND
99 ${CMAKE_C_COMPILER} --target =nvptx64-nvidia-cuda
10+ ${ARGN}
1011 -march=${LIBOMPTARGET_DEP_CUDA_ARCH}
1112 --cuda-path =${CUDA_ROOT}
1213 ${SRC_PATH} -o ${BIN_PATH}
@@ -21,6 +22,7 @@ macro(add_offload_test_device_code test_filename test_name)
2122 add_custom_command (OUTPUT ${BIN_PATH}
2223 COMMAND
2324 ${CMAKE_C_COMPILER} --target =amdgcn-amd-amdhsa -nogpulib
25+ ${ARGN}
2426 -mcpu=${LIBOMPTARGET_DEP_AMDGPU_ARCH}
2527 ${SRC_PATH} -o ${BIN_PATH}
2628 DEPENDS ${SRC_PATH}
@@ -61,7 +63,9 @@ endif()
6163
6264add_offload_test_device_code(foo.c foo)
6365add_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)
6569
6670add_custom_target (OffloadUnitTestsDeviceBins DEPENDS ${BIN_PATHS} )
6771
You can’t perform that action at this time.
0 commit comments