Add 'projects/rdc/' from commit '5ae7eeb3550d4cb14cbc31d3022e545b054f1ad1'

git-subtree-dir: projects/rdc
git-subtree-mainline: a68afa42a1
git-subtree-split: 5ae7eeb355
Tento commit je obsažen v:
systems-assistant[bot]
2025-07-22 22:52:37 +00:00
393 změnil soubory, kde provedl 49849 přidání a 0 odebrání
+38
Zobrazit soubor
@@ -0,0 +1,38 @@
# This module provides a rocprofiler::rocprofiler package
# You can specify the ROCM directory by setting ROCM_DIR
set(NAME rocprofiler)
if(NOT DEFINED ROCM_DIR)
set(ROCM_DIR "/opt/rocm")
endif()
list(APPEND CMAKE_PREFIX_PATH ${ROCM_DIR})
find_library(${NAME}_LIBRARY NAMES ${NAME} ${NAME}64 REQUIRED REGISTRY_VIEW BOTH PATH_SUFFIXES lib)
if(NOT DEFINED (${NAME}_INCLUDE_DIR))
find_path(
${NAME}_INCLUDE_DIR
NAMES ${NAME}.h
HINTS "${ROCM_DIR}/include"
PATH_SUFFIXES ${NAME} ${NAME}/inc
)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
${NAME}
FOUND_VAR ${NAME}_FOUND
REQUIRED_VARS ${NAME}_LIBRARY ${NAME}_INCLUDE_DIR
)
if(${NAME}_FOUND AND NOT TARGET ${NAME}::${NAME})
add_library(${NAME}::${NAME} UNKNOWN IMPORTED)
set_target_properties(
${NAME}::${NAME}
PROPERTIES
IMPORTED_LOCATION "${${NAME}_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_${NAME}_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIR}"
)
endif()
+68
Zobrazit soubor
@@ -0,0 +1,68 @@
# This module provides a rvs::rvs package
# You can specify the ROCM directory by setting ROCM_DIR
set(NAME rvs)
if(NOT DEFINED ROCM_DIR)
set(ROCM_DIR "/opt/rocm")
endif()
list(APPEND CMAKE_PREFIX_PATH ${ROCM_DIR})
find_library(
${NAME}_LIBRARY
NAMES
${NAME}
${NAME}64
${NAME}lib # RVS is special and is named librvslib.so
REQUIRED
REGISTRY_VIEW
BOTH
PATH_SUFFIXES lib
)
if(NOT DEFINED (${NAME}_INCLUDE_DIR))
find_path(
${NAME}_INCLUDE_DIR
NAMES ${NAME}.h
HINTS "${ROCM_DIR}/include"
PATH_SUFFIXES ${NAME} ${NAME}/inc
)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
${NAME}
FOUND_VAR ${NAME}_FOUND
REQUIRED_VARS ${NAME}_LIBRARY ${NAME}_INCLUDE_DIR
)
if(${NAME}_FOUND AND NOT TARGET ${NAME}::${NAME})
add_library(${NAME}::${NAME} UNKNOWN IMPORTED)
set_target_properties(
${NAME}::${NAME}
PROPERTIES
IMPORTED_LOCATION "${${NAME}_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_${NAME}_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIR}"
)
find_library(rocm-core NAMES rocm-core REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(rocblas REQUIRED)
find_package(hipblaslt REQUIRED)
find_package(hsakmt REQUIRED)
find_package(hip REQUIRED)
find_package(hsa-runtime64 REQUIRED)
find_package(amd_smi REQUIRED)
target_link_libraries(
${NAME}::${NAME}
INTERFACE
${rocm-core}
yaml-cpp
roc::rocblas
roc::hipblaslt
hsakmt::hsakmt
hip::amdhip64
hsa-runtime64::hsa-runtime64
amd_smi
)
endif()
+11
Zobrazit soubor
@@ -0,0 +1,11 @@
set(PACKAGE_VERSION "@RDC_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
+19
Zobrazit soubor
@@ -0,0 +1,19 @@
# - Config file for the rdc package
# It defines the following variables
# RDC_INCLUDE_DIRS - include directories for rdc
# RDC_LIBRARIES - libraries to link against
@PACKAGE_INIT@
# Compute paths
get_filename_component(RDC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(ROCM_RDC_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/${CMAKE_INSTALL_INCLUDEDIR}")
set(ROCM_RDC_LIB_DIR "${PACKAGE_PREFIX_DIR}/${CMAKE_INSTALL_LIBDIR}")
# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET rdc_libs AND NOT rdc_BINARY_DIR)
include("${RDC_CMAKE_DIR}/rdcTargets.cmake")
endif()
# These are IMPORTED targets created by rdcTargets.cmake
set(ROCM_RDC_LIBRARIES "@CONF_LIBS@")
+126
Zobrazit soubor
@@ -0,0 +1,126 @@
################################################################################
##
## The University of Illinois/NCSA
## Open Source License (NCSA)
##
## Copyright (c) 2014-2017, Advanced Micro Devices, Inc. All rights reserved.
##
## Developed by:
##
## AMD Research and AMD HSA Software Development
##
## Advanced Micro Devices, Inc.
##
## www.amd.com
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to
## deal with the Software without restriction, including without limitation
## the rights to use, copy, modify, merge, publish, distribute, sublicense,
## and#or sell copies of the Software, and to permit persons to whom the
## Software is furnished to do so, subject to the following conditions:
##
## - Redistributions of source code must retain the above copyright notice,
## this list of conditions and the following disclaimers.
## - Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimers in
## the documentation and#or other materials provided with the distribution.
## - Neither the names of Advanced Micro Devices, Inc,
## nor the names of its contributors may be used to endorse or promote
## products derived from this Software without specific prior written
## permission.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
## THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
## OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
## ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
## DEALINGS WITH THE SOFTWARE.
##
################################################################################
## Parses the VERSION_STRING variable and places
## the first, second and third number values in
## the major, minor and patch variables.
function(parse_version VERSION_STRING)
string(FIND ${VERSION_STRING} "-" STRING_INDEX)
if(${STRING_INDEX} GREATER -1)
math(EXPR STRING_INDEX "${STRING_INDEX} + 1")
string(SUBSTRING ${VERSION_STRING} ${STRING_INDEX} -1 VERSION_BUILD)
endif()
string(REGEX MATCHALL "[0123456789]+" VERSIONS ${VERSION_STRING})
list(LENGTH VERSIONS VERSION_COUNT)
if(${VERSION_COUNT} GREATER 0)
list(GET VERSIONS 0 MAJOR)
set(VERSION_MAJOR ${MAJOR} PARENT_SCOPE)
set(TEMP_VERSION_STRING "${MAJOR}")
endif()
if(${VERSION_COUNT} GREATER 1)
list(GET VERSIONS 1 MINOR)
set(VERSION_MINOR ${MINOR} PARENT_SCOPE)
set(TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${MINOR}")
endif()
if(${VERSION_COUNT} GREATER 2)
list(GET VERSIONS 2 PATCH)
set(VERSION_PATCH ${PATCH} PARENT_SCOPE)
set(TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${PATCH}")
endif()
set(VERSION_STRING "${TEMP_VERSION_STRING}" PARENT_SCOPE)
endfunction()
## Gets the current version of the repository
## using versioning tags and git describe.
## Passes back a packaging version string
## and a library version string.
function(get_version_from_tag DEFAULT_VERSION_STRING VERSION_PREFIX GIT)
parse_version(${DEFAULT_VERSION_STRING})
if(GIT)
execute_process(
COMMAND git describe --tags --dirty --long --match ${VERSION_PREFIX}-[0-9.]*
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE RESULT
)
if(${RESULT} EQUAL 0)
parse_version(${GIT_TAG_STRING})
endif()
endif()
set(VERSION_STRING "${VERSION_STRING}" PARENT_SCOPE)
set(VERSION_MAJOR "${VERSION_MAJOR}" PARENT_SCOPE)
set(VERSION_MINOR "${VERSION_MINOR}" PARENT_SCOPE)
set(VERSION_PATCH "${VERSION_PATCH}" PARENT_SCOPE)
endfunction()
function(num_change_since_prev_pkg VERSION_PREFIX)
find_program(get_commits NAMES version_util.sh PATHS ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
if(get_commits)
execute_process(
COMMAND ${get_commits} -c ${VERSION_PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE NUM_COMMITS
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE RESULT
)
set(NUM_COMMITS "${NUM_COMMITS}" PARENT_SCOPE)
if(${RESULT} EQUAL 0)
message("${NUM_COMMITS} were found since previous release")
else()
message("Unable to determine number of commits since previous release")
endif()
else()
message("WARNING: Didn't find version_util.sh")
set(NUM_COMMITS "unknown" PARENT_SCOPE)
endif()
endfunction()
+43
Zobrazit soubor
@@ -0,0 +1,43 @@
#!/bin/bash
# Handle commandline args
while [ "$1" != "" ]; do
case $1 in
-c ) # Commits since prevous tag
TARGET="count" ;;
* )
TARGET="count"
break ;;
esac
shift 1
done
TAG_PREFIX=$1
reg_ex="${TAG_PREFIX}*"
commits_since_last_tag() {
TAG_ARR=(`git tag --sort=committerdate -l ${reg_ex} | tail -2`)
# if we don't have 2 tags, just say there were 0 commits since
# last tag
if [ ${#TAG_ARR[@]} != 2 ]; then
echo 0
exit 0
fi
PREVIOUS_TAG=${TAG_ARR[0]}
CURRENT_TAG=${TAG_ARR[1]}
PREV_CMT_NUM=`git rev-list --count $PREVIOUS_TAG`
CURR_CMT_NUM=`git rev-list --count $CURRENT_TAG`
# Commits since prevous tag:
let NUM_COMMITS="${CURR_CMT_NUM}-${PREV_CMT_NUM}"
echo $NUM_COMMITS
}
case $TARGET in
count) commits_since_last_tag ;;
*) die "Invalid target $target" ;;
esac
exit 0