Файли
rocm-systems/tests/bin/hsa-queue-dependency/CMakeLists.txt
T
Gopesh Bhardwaj 348d740388 hsa multiqueue application (#618)
* hsa multiqueuw application

* cmake formatting (cmake-format) (#619)

Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>

* source formatting (clang-format v11) (#620)

Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>

* comppialtion fix

* Update tests/bin/CMakeLists.txt

Reorder `add_subdirectory` to fix (recurrent) issues with ROCTx in `CMAKE_BUILD_RPATH`

* addressing early feedback

* cmake updates

* more cmake updates

* adding queue dependency test

* updating test

* test updates

* removed hsa_api_trace header

* reformating headers to prevent clang from reordering

* Fixing packaging

* Fixes for hangs

* source formatting (clang-format v11) (#676)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* cmake formatting (cmake-format) (#673)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* structure change

* cmake formatting (cmake-format) (#680)

Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>

* Adding kernel trace to test hang fix

* rebased and fixed kernel-trace test

* rhel clang fixes

* source formatting (clang-format v11) (#685)

Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>

* Update lib/rocprofiler-sdk-tool/helper.hpp

- remove suppression of -Wshadow

* Update tests/bin/hsa-queue-dependency/CMakeLists.txt

- cleanup unnecessary code
- GPU_LIST -> GPU_TARGETS

* GPU_LIST -> GPU_TARGETS

* Remove installation of test executable and libraries

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2024-04-09 10:19:16 -05:00

90 рядки
2.9 KiB
CMake

#
#
# HSA multi-queue dependency test
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)
project(rocprofiler-tests-bin-hsa-multiqueue-dependency LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_program(
amdclangpp_EXECUTABLE REQUIRED
NAMES amdclang++
HINTS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATH_SUFFIXES bin llvm/bin NO_CACHE)
function(generate_hsaco TARGET_ID INPUT_FILE OUTPUT_FILE)
separate_arguments(
CLANG_ARG_LIST
UNIX_COMMAND
"-O2 -x cl -Xclang -finclude-default-header -cl-denorms-are-zero -cl-std=CL2.0 -Wl,--build-id=sha1
-target amdgcn-amd-amdhsa -mcpu=${TARGET_ID} -o ${OUTPUT_FILE} ${INPUT_FILE}")
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/${OUTPUT_FILE}
COMMAND ${amdclangpp_EXECUTABLE} ${CLANG_ARG_LIST}
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/${OUTPUT_FILE}
${CMAKE_BINARY_DIR}/tests/rocprofv3/hsa-queue-dependency/${OUTPUT_FILE}
OUTPUT ${CMAKE_BINARY_DIR}/tests/rocprofv3/hsa-queue-dependency/${OUTPUT_FILE}
COMMAND
${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/tests/rocprofv3/hsa-queue-dependency/${OUTPUT_FILE}
${CMAKE_BINARY_DIR}/rocprofv3/hsa-queue-dependency/${OUTPUT_FILE}
COMMENT "Building ${OUTPUT_FILE}...")
set(HSACO_TARGET_LIST
${HSACO_TARGET_LIST} ${PROJECT_BINARY_DIR}/${OUTPUT_FILE}
PARENT_SCOPE)
endfunction(generate_hsaco)
foreach(target_id ${GPU_TARGETS})
# generate kernel bitcodes
generate_hsaco(${target_id} ${CMAKE_CURRENT_SOURCE_DIR}/copy.cl
${target_id}_copy.hsaco)
endforeach(target_id)
add_custom_target(generate_hsaco_targets DEPENDS ${HSACO_TARGET_LIST})
add_executable(multiqueue_testapp)
target_sources(multiqueue_testapp PRIVATE multiqueue_app.cpp)
target_compile_options(multiqueue_testapp PRIVATE -W -Wall -Wextra -Wshadow -Werror)
find_package(Threads REQUIRED)
target_link_libraries(multiqueue_testapp PRIVATE stdc++fs Threads::Threads)
find_package(
amd_comgr
REQUIRED
CONFIG
HINTS
${CMAKE_INSTALL_PREFIX}
PATHS
${ROCM_PATH}
PATH_SUFFIXES
lib/cmake/amd_comgr)
target_link_libraries(multiqueue_testapp PRIVATE amd_comgr)
find_package(rocprofiler-sdk REQUIRED)
target_link_libraries(multiqueue_testapp PRIVATE rocprofiler::rocprofiler
rocprofiler::tests-common-library)
target_compile_definitions(multiqueue_testapp PUBLIC AMD_INTERNAL_BUILD=1)
find_package(
hsa-runtime64
REQUIRED
CONFIG
HINTS
${rocm_version_DIR}
${ROCM_PATH}
PATHS
${rocm_version_DIR}
${ROCM_PATH})
target_link_libraries(multiqueue_testapp PRIVATE hsa-runtime64::hsa-runtime64)
add_dependencies(multiqueue_testapp generate_hsaco_targets)