Merge in the rocclr based hip runtime (#2032)
* Merge master-next changes in master (include vdi development in master branch)
This commit is contained in:
@@ -222,12 +222,12 @@ if ($HIP_PLATFORM eq "clang") {
|
||||
$HIPCXXFLAGS .= " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1";
|
||||
}
|
||||
|
||||
if ($HIP_RUNTIME eq "HCC" ) {
|
||||
$HSA_PATH=$ENV{'HSA_PATH'} // "$ROCM_PATH/hsa";
|
||||
$HIPCXXFLAGS .= " -isystem $HSA_PATH/include";
|
||||
$HIPCFLAGS .= " -isystem $HSA_PATH/include";
|
||||
} else {
|
||||
$HIPCXXFLAGS .= " -fhip-new-launch-api";
|
||||
$HSA_PATH=$ENV{'HSA_PATH'} // "$ROCM_PATH/hsa";
|
||||
$HIPCXXFLAGS .= " -isystem $HSA_PATH/include";
|
||||
$HIPCFLAGS .= " -isystem $HSA_PATH/include";
|
||||
if (!($HIP_RUNTIME eq "HCC")) {
|
||||
$HIPCXXFLAGS .= " -D__HIP_VDI__ -fhip-new-launch-api";
|
||||
$HIPCFLAGS .= " -D__HIP_VDI__ -fhip-new-launch-api";
|
||||
}
|
||||
|
||||
} elsif ($HIP_PLATFORM eq "hcc") {
|
||||
@@ -245,6 +245,9 @@ if ($HIP_PLATFORM eq "clang") {
|
||||
$HCC_VERSION_MAJOR=$HCC_VERSION;
|
||||
$HCC_VERSION_MAJOR=~s/\..*//;
|
||||
|
||||
$HIP_ATP_MARKER=$ENV{'HIP_ATP_MARKER'} // 1;
|
||||
$marker_path = "$ROCM_PATH/profiler/CXLActivityLogger";
|
||||
|
||||
# HCC* may be used to compile src/hip_hcc.o (and also feed the HIPCXXFLAGS below)
|
||||
$HCC = "$HCC_HOME/bin/hcc";
|
||||
$HCCFLAGS = "-hc -D__HIPCC__ -isystem $HCC_HOME/include ";
|
||||
@@ -292,6 +295,20 @@ if ($HIP_PLATFORM eq "clang") {
|
||||
$HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am ";
|
||||
# $HIPLDFLAGS .= " -L$HCC_HOME/compiler/lib -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMMC -lLLVMCore -lLLVMSupport ";
|
||||
|
||||
# Add trace marker library:
|
||||
# TODO - once we cleanly separate the HIP API headers from HIP library headers this logic should move to CMakebuild option - apps do not need to see the marker library.
|
||||
if ($HIP_ATP_MARKER) {
|
||||
$marker_inc_path = "$marker_path/include";
|
||||
if (-e $marker_inc_path) {
|
||||
$HIPCXXFLAGS .= " -isystem $marker_inc_path";
|
||||
}
|
||||
}
|
||||
|
||||
$marker_lib_path = "$marker_path/bin/x86_64";
|
||||
if (-e $marker_lib_path) {
|
||||
$HIPLDFLAGS .= " -L$marker_lib_path -lCXLActivityLogger -Wl,--rpath=$marker_lib_path";
|
||||
}
|
||||
|
||||
if (not $isWindows) {
|
||||
$HIPLDFLAGS .= " -lm";
|
||||
}
|
||||
@@ -336,7 +353,10 @@ my $runCmd = 1;
|
||||
my $buildDeps = 0;
|
||||
my $linkType = 1;
|
||||
my $setLinkType = 0;
|
||||
my $coFormatv3 = 0;
|
||||
my $coFormatv3 = 1;
|
||||
if(defined $HIP_COMPILER and $HIP_COMPILER eq "hcc") {
|
||||
$coFormatv3 = 0;
|
||||
}
|
||||
my $funcSupp = 0; # enable function support
|
||||
|
||||
my @options = ();
|
||||
@@ -474,13 +494,6 @@ foreach $arg (@ARGV)
|
||||
$optArg = $arg;
|
||||
}
|
||||
|
||||
## This is a temporary workaround for CMake detection of OpenMP support.
|
||||
## It should be removed when the OpenMP detection c++ test in CMake is updated
|
||||
## and corrected CMake version is available.
|
||||
if((defined $HIP_COMPILER) and ($HIP_COMPILER eq "clang") and ($arg eq '-fopenmp')) {
|
||||
$HIPCXXFLAGS .= " -D_OPENMP "
|
||||
}
|
||||
|
||||
## process linker response file for hip-clang
|
||||
## extract object files from static library and pass them directly to
|
||||
## hip-clang in command line.
|
||||
|
||||
@@ -223,6 +223,10 @@ sub simpleSubstitutions {
|
||||
$ft{'memory'} += s/\bcuMemcpy2DAsync\b/hipMemcpyParam2DAsync/g;
|
||||
$ft{'memory'} += s/\bcuMemcpy2DAsync_v2\b/hipMemcpyParam2DAsync/g;
|
||||
$ft{'memory'} += s/\bcuMemcpy2D_v2\b/hipMemcpyParam2D/g;
|
||||
$ft{'memory'} += s/\bcuMemcpy3D\b/hipDrvMemcpy3D/g;
|
||||
$ft{'memory'} += s/\bcuMemcpy3DAsync\b/hipDrvMemcpy3DAsync/g;
|
||||
$ft{'memory'} += s/\bcuMemcpy3D_v2\b/hipDrvMemcpy3D/g;
|
||||
$ft{'memory'} += s/\bcuMemcpy3DAsync_v2\b/hipDrvMemcpy3DAsync/g;
|
||||
$ft{'memory'} += s/\bcuMemcpyAtoH\b/hipMemcpyAtoH/g;
|
||||
$ft{'memory'} += s/\bcuMemcpyAtoH_v2\b/hipMemcpyAtoH/g;
|
||||
$ft{'memory'} += s/\bcuMemcpyDtoD\b/hipMemcpyDtoD/g;
|
||||
@@ -979,6 +983,8 @@ sub simpleSubstitutions {
|
||||
$ft{'type'} += s/\bCUDA_ARRAY_DESCRIPTOR_st\b/HIP_ARRAY_DESCRIPTOR/g;
|
||||
$ft{'type'} += s/\bCUDA_MEMCPY2D\b/hip_Memcpy2D/g;
|
||||
$ft{'type'} += s/\bCUDA_MEMCPY2D_st\b/hip_Memcpy2D/g;
|
||||
$ft{'type'} += s/\bCUDA_MEMCPY3D\b/HIP_MEMCPY3D/g;
|
||||
$ft{'type'} += s/\bCUDA_MEMCPY3D_st\b/HIP_MEMCPY3D/g;
|
||||
$ft{'type'} += s/\bCUaddress_mode\b/hipTextureAddressMode/g;
|
||||
$ft{'type'} += s/\bCUaddress_mode_enum\b/hipTextureAddressMode/g;
|
||||
$ft{'type'} += s/\bCUarray\b/hipArray */g;
|
||||
|
||||
Reference in New Issue
Block a user