Add HIP_RUNTIME for HCC or VDI
This commit is contained in:
@@ -73,6 +73,15 @@ endif()
|
||||
message(STATUS "HIP Compiler: " ${HIP_COMPILER})
|
||||
add_to_config(_buildInfo HIP_COMPILER)
|
||||
|
||||
# Determine HIP_RUNTIME
|
||||
# Either HCC or VDI; default is HCC
|
||||
if(NOT DEFINED ENV{HIP_RUNTIME})
|
||||
set(HIP_RUNTIME "HCC" CACHE STRING "HIP Runtime")
|
||||
else()
|
||||
set(HIP_RUNTIME $ENV{HIP_RUNTIME} CACHE STRING "HIP Runtime")
|
||||
endif()
|
||||
add_to_config(_buildInfo HIP_RUNTIME)
|
||||
|
||||
|
||||
# If HIP_PLATFORM is hcc, we need HCC_HOME and HSA_PATH to be defined
|
||||
if(HIP_PLATFORM STREQUAL "hcc")
|
||||
|
||||
+16
-4
@@ -58,8 +58,8 @@ $HIPCC_LINK_FLAGS_APPEND=$ENV{'HIPCC_LINK_FLAGS_APPEND'};
|
||||
|
||||
$HIP_PATH=$ENV{'HIP_PATH'} // dirname (dirname $0); # use parent directory of hipcc
|
||||
$HIP_VDI_HOME=$ENV{'HIP_VDI_HOME'};
|
||||
$HIP_CLANG_PATH=$ENV{'HIP_CLANG_PATH'} // "/opt/rocm/llvm/bin";
|
||||
$DEVICE_LIB_PATH=$ENV{'DEVICE_LIB_PATH'} // "/opt/rocm/lib";
|
||||
$HIP_CLANG_PATH=$ENV{'HIP_CLANG_PATH'};
|
||||
$DEVICE_LIB_PATH=$ENV{'DEVICE_LIB_PATH'};
|
||||
$HIP_CLANG_HCC_COMPAT_MODE=$ENV{'HIP_CLANG_HCC_COMPAT_MODE'}; # HCC compatibility mode
|
||||
|
||||
#---
|
||||
@@ -93,7 +93,13 @@ sub delete_temp_dirs {
|
||||
$HIP_PLATFORM= `$HIP_PATH/bin/hipconfig --platform` // "hcc";
|
||||
$HIP_VERSION= `$HIP_PATH/bin/hipconfig --version`;
|
||||
($HIP_VERSION_MAJOR, $HIP_VERSION_MINOR, $HIP_VERSION_PATCH) = split(/\./, $HIP_VERSION);
|
||||
$HIP_COMPILER=$hipConfig{'HIP_COMPILER'};
|
||||
$HIP_COMPILER= $hipConfig{'HIP_COMPILER'};
|
||||
$HIP_RUNTIME= $hipConfig{'HIP_RUNTIME'};
|
||||
|
||||
# If using VDI runtime, need to find HIP_VDI_HOME
|
||||
if ($HIP_RUNTIME eq "VDI" and !defined $HIP_VDI_HOME) {
|
||||
$HIP_VDI_HOME = "/opt/rocm/hip"
|
||||
}
|
||||
|
||||
if (defined $HIP_VDI_HOME) {
|
||||
my $bits = "";
|
||||
@@ -112,7 +118,13 @@ if (defined $HIP_VDI_HOME) {
|
||||
}
|
||||
|
||||
if ($HIP_COMPILER eq "clang") {
|
||||
$HIP_PLATFORM = "clang"
|
||||
$HIP_PLATFORM = "clang";
|
||||
if (!defined $HIP_CLANG_PATH) {
|
||||
$HIP_CLANG_PATH = "/opt/rocm/llvm/bin";
|
||||
}
|
||||
if (!defined $DEVICE_LIB_PATH) {
|
||||
$DEVICE_LIB_PATH = "/opt/rocm/lib";
|
||||
}
|
||||
}
|
||||
|
||||
if ($verbose & 0x2) {
|
||||
|
||||
مرجع در شماره جدید
Block a user