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
85 lines
2.3 KiB
CMake
85 lines
2.3 KiB
CMake
# Copyright (c) Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
include_guard(DIRECTORY)
|
|
|
|
# Compilers
|
|
|
|
# AMD LLVM compilers
|
|
find_program(
|
|
amdclangpp_EXECUTABLE
|
|
NAMES amdclang++
|
|
HINTS ${ROCM_PATH}
|
|
ENV ROCM_PATH
|
|
/opt/rocm
|
|
PATHS ${ROCM_PATH}
|
|
ENV ROCM_PATH
|
|
/opt/rocm
|
|
PATH_SUFFIXES bin llvm/bin
|
|
)
|
|
mark_as_advanced(amdclangpp_EXECUTABLE)
|
|
|
|
find_program(
|
|
amdflang_EXECUTABLE
|
|
NAMES amdflang
|
|
HINTS ${ROCM_PATH}
|
|
ENV ROCM_PATH
|
|
/opt/rocm
|
|
PATHS ${ROCM_PATH}
|
|
ENV ROCM_PATH
|
|
/opt/rocm
|
|
PATH_SUFFIXES bin llvm/bin
|
|
)
|
|
mark_as_advanced(amdflang_EXECUTABLE)
|
|
|
|
# HIP Compiler
|
|
find_program(
|
|
HIPCC_EXECUTABLE
|
|
NAMES hipcc
|
|
HINTS ${ROCmVersion_DIR} ${ROCM_PATH}
|
|
ENV ROCM_PATH
|
|
/opt/rocm
|
|
PATHS ${ROCmVersion_DIR} ${ROCM_PATH}
|
|
ENV ROCM_PATH
|
|
/opt/rocm
|
|
NO_CACHE
|
|
)
|
|
mark_as_advanced(HIPCC_EXECUTABLE)
|
|
|
|
# Check the compiler version (works for amdclang++, amdflang, hipcc, etc.)
|
|
# For HIPCC, this returns the underlying CLANG version, not HIP version
|
|
function(CHECK_COMPILER_VERSION _COMPILER _OUTPUT)
|
|
execute_process(
|
|
COMMAND ${_COMPILER} --version
|
|
OUTPUT_VARIABLE _VERSION_OUTPUT
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
ERROR_QUIET
|
|
)
|
|
# Match "clang version X" or "flang-new version X" (AMD compiler line)
|
|
# This skips "HIP version:" which appears first in hipcc output
|
|
string(REGEX MATCH "(clang|flang-new) version ([0-9]+)" _MATCH "${_VERSION_OUTPUT}")
|
|
set(${_OUTPUT} "${CMAKE_MATCH_2}" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
# Outputs a bool if the _EXAMPLE_NAME is in ROCPROFSYS_DISABLE_EXAMPLES
|
|
function(CHECK_ROCPROFSYS_DISABLE_EXAMPLES _EXAMPLE_NAME _OUTPUT)
|
|
if(ROCPROFSYS_DISABLE_EXAMPLES)
|
|
if("${_EXAMPLE_NAME}" IN_LIST ROCPROFSYS_DISABLE_EXAMPLES)
|
|
set(${_OUTPUT} TRUE PARENT_SCOPE)
|
|
return()
|
|
endif()
|
|
endif()
|
|
set(${_OUTPUT} FALSE PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
# Handle example installation
|
|
function(ROCPROFILER_SYSTEMS_INSTALL_HPC_EXAMPLE _EXAMPLE_NAME)
|
|
if(ROCPROFSYS_INSTALL_EXAMPLES AND TARGET ${_EXAMPLE_NAME})
|
|
install(
|
|
TARGETS ${_EXAMPLE_NAME}
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/rocprofiler-systems/examples
|
|
COMPONENT rocprofiler-systems-examples
|
|
)
|
|
endif()
|
|
endfunction()
|