Files
TheRock/rocm-systems/projects/hipfile/examples/async/CMakeLists.txt
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

77 lines
2.7 KiB
CMake

# Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
#
# SPDX-License-Identifier: MIT
# Async examples for the hipFile C API. They build with the AIS infrastructure
# (ais_add_executable) and link the shared helpers from the examples_common
# target defined in examples/common; the parent CMakeLists adds examples/common
# before examples/async, so the target is in scope here. examples_common is
# PUBLIC-linked against hipfile and exports its own include dir, so
# DEPS examples_common transitively supplies the library and headers.
include(AISAddExecutable)
set(ASYNC_EXAMPLES
roundtrip-async
roundtrip-async-nonblocking-stream
roundtrip-async-multi-stream
roundtrip-async-multi-stream-registered
)
foreach(example ${ASYNC_EXAMPLES})
ais_add_executable(
NAME ${example}
DEPS examples_common
SRCS "${example}.cpp"
SYSINCLS ${HIPFILE_INCLUDE_PATH}
)
endforeach()
# CTest wrappers: run each async example as a hipFile system test.
# Gated on BUILD_TESTING; AIS_INSTALL_EXAMPLES is already enforced by the
# parent CMakeLists which only adds this subdirectory when examples are built.
if(BUILD_TESTING)
# Unique-per-configure scratch dir so concurrent ctest runs / multiple
# checkouts don't collide on a shared path. Kept under AIS_CAPABLE_DIR
# because the e2e tests need an O_DIRECT-capable local FS — the build
# tree may live on overlay/nfs and isn't a safe default.
execute_process(
COMMAND cat /proc/sys/kernel/random/uuid
OUTPUT_VARIABLE _async_scratch_token
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(ASYNC_TEST_DIR
"${AIS_CAPABLE_DIR}/hipfile_async_tests_${_async_scratch_token}"
)
add_test(
NAME async_setup_dir
COMMAND ${CMAKE_COMMAND} -E make_directory ${ASYNC_TEST_DIR}
)
add_test(
NAME async_cleanup
COMMAND ${CMAKE_COMMAND} -E rm -rf ${ASYNC_TEST_DIR}
)
set_tests_properties(async_setup_dir PROPERTIES
FIXTURES_SETUP async_scratch
)
set_tests_properties(async_cleanup PROPERTIES
FIXTURES_CLEANUP async_scratch
)
# Each async example calls seed_read_file() to truncate+seed its READ_FILE,
# so we give every test its own input path. This avoids parallel-run races
# on a shared input file and removes the need for an upfront dd seeding.
foreach(example ${ASYNC_EXAMPLES})
add_test(
NAME async_${example}
COMMAND $<TARGET_FILE:${example}> in_${example}.bin out_${example}.bin
WORKING_DIRECTORY ${ASYNC_TEST_DIR}
)
set_tests_properties(async_${example} PROPERTIES
FIXTURES_REQUIRED async_scratch
LABELS "system;hipfile;async"
)
endforeach()
endif()