Files
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

75 lines
2.3 KiB
CMake

# Copyright Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT
find_package(Catch2 3 QUIET CONFIG)
if(NOT Catch2_FOUND)
if(ORIGAMI_ENABLE_FETCH)
include(FetchContent)
fetchcontent_declare(
Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_TAG devel
)
fetchcontent_makeavailable(Catch2)
else()
message(FATAL_ERROR "Failed to find Catch2")
endif()
endif()
add_executable(origami-tests)
target_sources(
origami-tests PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/test_attention.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/test_gemm.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/test_origami.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/test_formocast.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/test_logger.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/test_streamk.cpp"
)
target_include_directories(origami-tests PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(origami-tests PRIVATE roc::origami Catch2::Catch2WithMain)
include(CTest)
include(Catch)
catch_discover_tests(origami-tests
DISCOVERY_MODE PRE_TEST
)
# Install CTestTestfile.cmake for installed Origami tests
set(_ctest_content [=[
# Copyright Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT
# C++ tests
add_test(origami-tests "../origami-tests")
set_tests_properties(origami-tests PROPERTIES
LABELS "cpp"
)
]=])
if(ORIGAMI_ENABLE_PYTHON)
find_package(Python COMPONENTS Interpreter REQUIRED)
string(APPEND _ctest_content [=[
# Python tests (using pytest)
add_test(origami_python_tests python3 -m pytest "tests" -v)
set_tests_properties(origami_python_tests PROPERTIES
LABELS "python"
SKIP_RETURN_CODE 5
ENVIRONMENT "LD_LIBRARY_PATH=../../@CMAKE_INSTALL_LIBDIR@:$ENV{LD_LIBRARY_PATH};PYTHONPATH=../../@CMAKE_INSTALL_LIBDIR@/python@Python_VERSION_MAJOR@.@Python_VERSION_MINOR@/site-packages:$ENV{PYTHONPATH}"
)
]=])
endif()
string(CONFIGURE "${_ctest_content}" _ctest_content @ONLY)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake.install" "${_ctest_content}")
rocm_install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake.install"
DESTINATION "${CMAKE_INSTALL_BINDIR}/origami"
COMPONENT tests
RENAME CTestTestfile.cmake
)