Files
TheRock/examples/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

68 lines
3.0 KiB
CMake

# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
# TODO: HIP language support not based on an /opt/rocm installed SDK
# must have these three cache variables set to avoid language setup
# error. https://github.com/ROCm/TheRock/issues/102
set(HIP_CMAKE_ARGS
-DCMAKE_HIP_PLATFORM=amd
"-DCMAKE_HIP_COMPILER_ROCM_ROOT=${THEROCK_BINARY_DIR}/dist/rocm"
)
if(WIN32)
# On Windows, only a unified compiler is supported (i.e. use the HIP compiler
# for everything).
list(APPEND HIP_CMAKE_ARGS
"-DCMAKE_CXX_COMPILER=${THEROCK_BINARY_DIR}/dist/rocm/lib/llvm/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}"
)
else()
# On everything else, the HIP language compiler can be independent from the
# overall CXX compiler.
list(APPEND HIP_CMAKE_ARGS
"-DCMAKE_HIP_COMPILER=${THEROCK_BINARY_DIR}/dist/rocm/lib/llvm/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}"
)
endif()
# hipTensor is only built when composable_kernel is also built (CK is a hard
# build dependency). _ck_enabled, set by math-libs/CMakeLists.txt, is OFF when
# CK was filtered out for the selected gfx targets, in which case hipTensor is
# not declared even though THEROCK_ENABLE_HIPTENSOR is ON. Reflect the actual
# built status so the example does not find_package() a missing hiptensor.
set(_hiptensor_available OFF)
if(_ck_enabled AND THEROCK_ENABLE_HIPTENSOR)
set(_hiptensor_available ON)
endif()
# Examples are configured against the installed ROCm prefix. The
# cpp-sdk-user project requires HIP (LANGUAGES CXX HIP), so skip when
# HIP is not enabled (e.g. in early multi-arch CI stages) or when
# sanitizers are enabled (sanitizer builds do not install HIP).
if(THEROCK_ENABLE_HIP_RUNTIME AND "${THEROCK_SANITIZER}" STREQUAL "")
add_test(
NAME therock-examples-cpp-sdk-user
COMMAND
"${CMAKE_COMMAND}" -E env "CMAKE_PREFIX_PATH=${THEROCK_BINARY_DIR}/dist/rocm" --
"${CMAKE_COMMAND}"
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/cpp-sdk-user"
"-DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/cpp-sdk-user"
"-DGENERATOR=${CMAKE_GENERATOR}"
"-DTHEROCK_ENABLE_BLAS=${THEROCK_ENABLE_BLAS}"
"-DTHEROCK_ENABLE_FFT=${THEROCK_ENABLE_FFT}"
"-DTHEROCK_ENABLE_HIP=${THEROCK_ENABLE_HIP_RUNTIME}"
"-DTHEROCK_ENABLE_HIPDNN=${THEROCK_ENABLE_HIPDNN}"
"-DTHEROCK_ENABLE_LIBHIPCXX=${THEROCK_ENABLE_LIBHIPCXX}"
"-DTHEROCK_ENABLE_MIOPEN=${THEROCK_ENABLE_MIOPEN}"
"-DTHEROCK_ENABLE_HIPTENSOR=${_hiptensor_available}"
"-DTHEROCK_ENABLE_PRIM=${THEROCK_ENABLE_PRIM}"
"-DTHEROCK_ENABLE_RAND=${THEROCK_ENABLE_RAND}"
"-DTHEROCK_ENABLE_RCCL=${THEROCK_ENABLE_RCCL}"
"-DTHEROCK_ENABLE_ROCWMMA=${THEROCK_ENABLE_ROCWMMA}"
"-DTHEROCK_ENABLE_ROCALUTION=${THEROCK_ENABLE_ROCALUTION}"
"-DTHEROCK_ENABLE_LIBHIPCXX=${THEROCK_ENABLE_LIBHIPCXX}"
"-DTHEROCK_ENABLE_SOLVER=${THEROCK_ENABLE_SOLVER}"
"-DTHEROCK_ENABLE_SPARSE=${THEROCK_ENABLE_SPARSE}"
${HIP_CMAKE_ARGS}
-P "${CMAKE_CURRENT_SOURCE_DIR}/clean_configure_test_project.cmake"
)
endif()