Merge branch 'amd-master-next' into amd-npi-next

Change-Id: Icd651e93f0c28eb2859f4997377379d0698ce84e


[ROCm/hip commit: d041d30e65]
Cette révision appartient à :
Vlad Sytchenko
2020-04-29 18:54:58 -04:00
révision fe694d6b52
272 fichiers modifiés avec 6953 ajouts et 24322 suppressions
+249
Voir le fichier
@@ -0,0 +1,249 @@
#!/usr/bin/perl
use strict;
use File::Copy;
use File::Spec;
use File::Basename;
use File::Which;
use Cwd 'realpath';
use Getopt::Std;
use List::Util qw(max);
sub usage {
print("Usage: $0 [OPTION]... -i <input>\n");
print("Extract the device kernels from an hcc executable.\n\n");
print("-h \t\t\t\tshow this help message\n");
print("-i <input> \t\t\t\tinput file\n");
exit;
}
my $debug = 0;
# use clang offload bundler (instead of "dd")
# to extract device object from the bundle
my $use_clang_offload_bundler = 1;
my %options=();
getopts('hi:', \%options);
if (!%options || defined $options{h}) {
usage();
}
my $input_file;
defined $options{i} || die("input not specified");
$input_file = $options{i};
(-f $input_file) || die("can't find $input_file");
# look for llvm-objdump and clang-offload-bundler
my $tools_path_prefix;
my $llvm_objdump;
my $clang_offload_bundler;
if (defined $ENV{'HCC_HOME'}) {
$tools_path_prefix = File::Spec->catfile($ENV{'HCC_HOME'}, "bin");
$llvm_objdump = File::Spec->catfile($tools_path_prefix, "llvm-objdump");
$clang_offload_bundler = File::Spec->catfile($tools_path_prefix, "clang-offload-bundler");
}
else {
$tools_path_prefix = dirname(realpath($0));
$llvm_objdump = File::Spec->catfile($tools_path_prefix, "llvm-objdump");
$clang_offload_bundler = File::Spec->catfile($tools_path_prefix, "clang-offload-bundler");
if (!(-f $llvm_objdump)) {
$tools_path_prefix = realpath($tools_path_prefix."/../../hcc/bin");
$llvm_objdump = File::Spec->catfile($tools_path_prefix, "llvm-objdump");
$clang_offload_bundler = File::Spec->catfile($tools_path_prefix, "clang-offload-bundler");
}
}
if (!(-f $llvm_objdump)) {
$llvm_objdump = which("llvm-objdump");
if (!(-f $llvm_objdump)) {
die("Can't find llvm-objdump\n");
}
}
if (!(-f $clang_offload_bundler)) {
$clang_offload_bundler = which("clang-offload-bundler");
if (!(-f $clang_offload_bundler)) {
die("Can't find clang-offload-bundler\n");
}
}
# kernel section information for HCC
my $kernel_section_name = ".kernel";
my $kernel_triple = "hcc-amdgcn-amd-amdhsa--";
my $kernel_blob_alignment = 1;
my $kernel_section_size = hex(`objdump -h $input_file | grep $kernel_section_name | awk '{print \$3}'`);
if (!$kernel_section_size) {
# If there isn't a section created by HCC,
# try to detect a kernel section created by HIP-Clang
$kernel_section_name = ".hip_fatbin";
$kernel_triple = "hip-amdgcn-amd-amdhsa-";
$kernel_blob_alignment = 8;
$kernel_section_size = hex(`objdump -h $input_file | grep $kernel_section_name | awk '{print \$3}'`);
$kernel_section_size or die("No kernel section found\n");
}
my $kernel_section_offset = hex(`objdump -h $input_file | grep $kernel_section_name | awk '{print \$6}'`);
my $kernel_section_end = $kernel_section_offset + $kernel_section_size;
if ($debug) {
print "kernel section size: $kernel_section_size\n";
print "kernel section offset: $kernel_section_offset\n";
print "kernel section end: $kernel_section_end\n";
}
# parse kernel bundle header
open INPUT_FP, $input_file || die $!;
binmode INPUT_FP;
my $current_blob_offset = $kernel_section_offset;
my $num_blobs = 0;
#while ($current_blob_offset < $kernel_section_end) {
while(1) {
# adjust the offset to the blob alignment
$current_blob_offset = int(($current_blob_offset + ($kernel_blob_alignment - 1)) / $kernel_blob_alignment) * $kernel_blob_alignment;
if ($debug) {
print "Current blob offset: $current_blob_offset\n";
}
if ($current_blob_offset >= $kernel_section_end) {
if ($debug) {
print "reached end of kernel section\n";
}
last;
}
seek(INPUT_FP, $current_blob_offset, 0);
# skip OFFLOAD_BUNDLER_MAGIC_STR
my $magic_str;
my $read_bytes = read(INPUT_FP, $magic_str, 24);
if (($read_bytes != 24) || ($magic_str ne "__CLANG_OFFLOAD_BUNDLE__")) {
# didn't detect the bundle magic string
if ($debug) {
print "Offload bundle magic string not detected\n";
}
last;
}
# read number of bundles
my $num_bundles;
$read_bytes = read(INPUT_FP, $num_bundles, 8);
$read_bytes == 8 or die("Fail to parse number of bundles\n");
$num_bundles = unpack("Q", $num_bundles);
if ($debug) {
print "Blob $num_blobs, number of bundles: $num_bundles\n";
}
# detected GPU targets
my @asic_target_array;
my $last_bundle_offset = 0;
my $last_bundle_size = 0;
# strings for creating new files
my $file_blob_number = sprintf("%03d", $num_blobs);
my $filename_prefix = "${input_file}-${file_blob_number}";
my $clang_offloadbundler_outputs="-outputs=/dev/null";
my $clang_offloadbundler_targets="-targets=host-x86_64-unknown-linux";
for (my $iter = 0; $iter < $num_bundles; $iter++) {
# read bundle offset
my $offset;
$read_bytes = read(INPUT_FP, $offset, 8);
$read_bytes == 8 or die("Fail to parse bundle offset\n");
$offset = unpack("Q", $offset);
$last_bundle_offset = max($last_bundle_offset, $offset);
# read bundle size
my $size;
$read_bytes = read(INPUT_FP, $size, 8);
$read_bytes == 8 or die("Fail to parse bundle size\n");
$size = unpack("Q", $size);
if ($last_bundle_offset == $offset) {
$last_bundle_size = $size;
}
# read triple size
my $triple_size;
$read_bytes = read(INPUT_FP, $triple_size, 8);
$read_bytes == 8 or die("Fail to parse triple size\n");
$triple_size = unpack("Q", $triple_size);
# triple
my $triple;
$read_bytes = read(INPUT_FP, $triple, $triple_size);
$read_bytes == $triple_size or die("Fail to parse triple\n");
if ($debug) {
print("\t bundle $iter: offset=$offset, size=$size, triple_size=$triple_size, triple=$triple\n");
}
# Only process GPU targets, skip host targets
my $triple_pattern = "^$kernel_triple";
if ($triple =~ /$triple_pattern/) {
my $asic_target = substr($triple, length($kernel_triple));
# augment arguments for clang-offload-bundler
my $hsaco_file_name = "${filename_prefix}-${asic_target}.hsaco";
$clang_offloadbundler_outputs = "${clang_offloadbundler_outputs},${hsaco_file_name}";
$clang_offloadbundler_targets = "${clang_offloadbundler_targets},${triple}";
# add into asic_target_array
$asic_target_array[$#asic_target_array + 1]=$asic_target;
if (!$use_clang_offload_bundler) {
my $offset_for_hsaco = $current_blob_offset + $offset;
my $dd_command ="dd if=${input_file} of=${hsaco_file_name} skip=$offset_for_hsaco count=$size bs=1 status=none";
if ($debug) {
print("extract code bundle with dd: $dd_command\n");
}
system($dd_command) == 0
or die("Fail to extract code bundle with dd\n");
}
} else {
#print("Host target: " . $Triple . "\n");
}
}
# extract the code blob
my $blob_filename = "${filename_prefix}.bundle";
my $write_bytes = $last_bundle_offset + $last_bundle_size;
system("dd if=$input_file of=$blob_filename skip=$current_blob_offset count=$write_bytes bs=1 status=none") == 0
or die("Extracting kernel bundle file failed: $?");
if ($use_clang_offload_bundler) {
# use clang-offload-bundler to unbundle HSACO
my $command = "${clang_offload_bundler} -unbundle -type=o -inputs=${blob_filename} ${clang_offloadbundler_outputs} ${clang_offloadbundler_targets}";
if ($debug) {
print("clang offload bundler command: $command\n");
}
system($command) == 0
or die("Fail to execute clang-offload-bundler");
}
for (my $iter = 0; $iter <= $#asic_target_array; $iter++) {
my $asic_target = $asic_target_array[$iter];
my $hsaco_file_name = "${filename_prefix}-${asic_target}.hsaco";
my $isa_file_name = "${filename_prefix}-${asic_target}.isa";
# use llvm-objdump to dump out GCN ISA
system("$llvm_objdump --disassemble --mcpu=$asic_target $hsaco_file_name > $isa_file_name") == 0 or die("Fail to disassemble AMDGPU ISA for target" . $asic_target);
if ($debug) {
print("Generated GCN ISA for " . $asic_target . " at: " . $isa_file_name . "\n");
}
}
$current_blob_offset = $current_blob_offset + $last_bundle_offset + $last_bundle_size;
$num_blobs++;
}
$num_blobs or die("No device code found.\n");
exit(0);
+103 -26
Voir le fichier
@@ -85,6 +85,7 @@ $HIP_LIB_PATH=$ENV{'HIP_LIB_PATH'};
$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
$HIP_COMPILE_CXX_AS_HIP=$ENV{'HIP_COMPILE_CXX_AS_HIP'} // "1";
if (defined $HIP_VDI_HOME) {
$HIP_INFO_PATH= "$HIP_VDI_HOME/lib/.hipInfo";
@@ -134,6 +135,7 @@ if (defined $HIP_RUNTIME and $HIP_RUNTIME eq "VDI" and !defined $HIP_VDI_HOME) {
$HIP_VDI_HOME = $HIP_PATH; # use HIP_PATH
}
$HIPCXXFLAGS .= "-D__HIP_VDI__";
$HIPCFLAGS .= "-D__HIP_VDI__";
}
if (defined $HIP_VDI_HOME) {
@@ -207,12 +209,10 @@ if ($HIP_PLATFORM eq "clang") {
} else {
$HIPCXXFLAGS .= " -std=c++11";
}
$HIPCXXFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH";
$HIPCXXFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH/..";
$HIPCFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH/..";
$HIPLDFLAGS .= " -L$HIP_LIB_PATH";
if (not $isWindows) {
$HIPLDFLAGS .= " -Wl,--rpath-link=$HIP_LIB_PATH";
$HIPLDFLAGS .= " -lhip_hcc";
} else {
if ($isWindows) {
$HIPLDFLAGS .= " -lamdhip64";
}
if ($HIP_CLANG_HCC_COMPAT_MODE) {
@@ -222,8 +222,10 @@ if ($HIP_PLATFORM eq "clang") {
$HSA_PATH=$ENV{'HSA_PATH'} // "$ROCM_PATH/hsa";
$HIPCXXFLAGS .= " -isystem $HSA_PATH/include";
if (!($HIP_RUNTIME eq "HCC")) {
$HIPCXXFLAGS .= " -D__HIP_VDI__ -fhip-new-launch-api";
$HIPCFLAGS .= " -isystem $HSA_PATH/include";
if ($HIP_RUNTIME ne "HCC" ) {
$HIPCXXFLAGS .= " -D__HIP_VDI__";
$HIPCFLAGS .= " -D__HIP_VDI__";
}
} elsif ($HIP_PLATFORM eq "hcc") {
@@ -282,8 +284,11 @@ if ($HIP_PLATFORM eq "clang") {
}
$HIPCXXFLAGS .= " -isystem $HIP_PATH/include/hip/hcc_detail/cuda";
$HIPCFLAGS .= " -isystem $HIP_PATH/include/hip/hcc_detail/cuda";
$HIPCXXFLAGS .= " -isystem $HSA_PATH/include";
$HIPCFLAGS .= " -isystem $HSA_PATH/include";
$HIPCXXFLAGS .= " -Wno-deprecated-register";
$HIPCFLAGS .= " -Wno-deprecated-register";
$HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am ";
# $HIPLDFLAGS .= " -L$HCC_HOME/compiler/lib -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMMC -lLLVMCore -lLLVMSupport ";
@@ -321,6 +326,7 @@ if ($HIP_PLATFORM eq "clang") {
$HIPCC="$CUDA_PATH/bin/nvcc";
$HIPCXXFLAGS .= " -Wno-deprecated-gpu-targets ";
$HIPCXXFLAGS .= " -isystem $CUDA_PATH/include";
$HIPCFLAGS .= " -isystem $CUDA_PATH/include";
$HIPLDFLAGS = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L$CUDA_PATH/lib64";
} else {
@@ -330,19 +336,30 @@ if ($HIP_PLATFORM eq "clang") {
# Add paths to common HIP includes:
$HIPCXXFLAGS .= " -isystem $HIP_INCLUDE_PATH" ;
$HIPCFLAGS .= " -isystem $HIP_INCLUDE_PATH" ;
my $compileOnly = 0;
my $needCXXFLAGS = 0; # need to add CXX flags to compile step
my $needCFLAGS = 0; # need to add C flags to compile step
my $needLDFLAGS = 1; # need to add LDFLAGS to compile step.
my $hasC = 0; # options contain a c-style file (NVCC must force recognition as GPU file)
my $hasC = 0; # options contain a c-style file
my $hasCXX = 0; # options contain a cpp-style file (NVCC must force recognition as GPU file)
my $hasCU = 0; # options contain a cu-style file (HCC must force recognition as GPU file)
my $hasHIP = 0; # options contain a hip-style file (HIP-Clang must pass offloading options)
my $needHipHcc = ($HIP_PLATFORM eq 'hcc'); # set if we need to link hip_hcc.o from src tree. (some builds, ie cmake, provide their own)
my $printHipVersion = 0; # print HIP version
my $printCXXFlags = 0; # print HIPCXXFLAGS
my $printLDFlags = 0; # print HIPLDFLAGS
my $runCmd = 1;
my $buildDeps = 0;
my $linkType = 1;
my $setLinkType = 0;
my $coFormatv3 = 1;
if(defined $HIP_COMPILER and $HIP_COMPILER eq "hcc") {
$coFormatv3 = 0;
}
my $funcSupp = 0; # enable function support
my $rdc = 0; # whether -fgpu-rdc is on
my @options = ();
my @inputs = ();
@@ -392,6 +409,7 @@ my $optArg = ""; # -O args
my $targetOpt = '--amdgpu-target=';
my $targetsStr = "";
my $skipOutputFile = 0; # file followed by -o should not contibute in picking compiler flags
my $prevArg = ""; # previous argument
foreach $arg (@ARGV)
{
@@ -400,12 +418,12 @@ foreach $arg (@ARGV)
my $swallowArg = 0;
if ($arg eq '-c' or $arg eq '--genco') {
$compileOnly = 1;
$needCXXFLAGS = 1;
$needLDFLAGS = 0;
}
if ($skipOutputFile) {
$toolArgs .= " $arg";
$prevArg = $arg;
$skipOutputFile = 0;
next;
}
@@ -457,17 +475,27 @@ foreach $arg (@ARGV)
$printHipVersion = 1;
$runCmd = 0;
}
if($trimarg eq '--cxxflags') {
$printCXXFlags = 1;
$runCmd = 0;
}
if($trimarg eq '--ldflags') {
$printLDFlags = 1;
$runCmd = 0;
}
if($trimarg eq '-M') {
$compileOnly = 1;
$buildDeps = 1;
}
if($trimarg eq '-use_fast_math') {
$HIPCXXFLAGS .= " -DHIP_FAST_MATH ";
$HIPCFLAGS .= " -DHIP_FAST_MATH ";
}
if(($trimarg eq '-use-staticlib') and ($setLinkType eq 0))
{
$linkType = 0;
$setLinkType = 1;
$swallowArg = 1;
}
if(($trimarg eq '-use-sharedlib') and ($setLinkType eq 0))
{
@@ -590,8 +618,15 @@ foreach $arg (@ARGV)
$toolArgs = substr $toolArgs, 0, -8;
chomp $toolArgs;
}
} elsif ($arg eq 'hip' and $prevArg eq '-x') {
$hasHIP = 1;
} elsif ($arg =~ m/^-/) {
# options start with -
if ($arg eq '-fgpu-rdc') {
$rdc = 1;
} elsif ($arg eq '-fno-gpu-rdc') {
$rdc = 0;
}
# Process HIPCC options here:
if ($arg =~ m/^--hipcc/) {
@@ -599,31 +634,45 @@ foreach $arg (@ARGV)
#if $arg eq "--hipcc_profile") { # Example argument here, hipcc
#
#}
if ($arg eq "--hipcc-func-supp") {
$funcSupp = 1;
} elsif ($arg eq "--hipcc-no-func-supp") {
$funcSupp = 0;
}
} else {
push (@options, $arg);
}
#print "O: <$arg>\n";
} else {
} elsif ($prevArg ne '-o') {
# input files and libraries
if (($arg =~ /\.cpp$/) or ($arg =~ /\.cxx$/) or ($arg =~ /\.c$/) or ($arg =~ /\.cc$/) ) {
if ($arg =~ /\.c$/) {
$hasC = 1;
$needCFLAGS = 1;
$toolArgs .= " -x c"
}
elsif (($arg =~ /\.cpp$/) or ($arg =~ /\.cxx$/) or ($arg =~ /\.cc$/) ) {
$needCXXFLAGS = 1;
if ($HIP_PLATFORM eq 'clang') {
$toolArgs .= " -x hip"
if ($HIP_COMPILE_CXX_AS_HIP eq '0' or $HIP_COMPILER ne "clang") {
$hasCXX = 1;
} else {
$hasHIP = 1;
$toolArgs .= " -x hip";
}
}
if (($arg =~ /\.cu$/) or ($arg =~ /\.cuh$/) or ($arg =~ /\.hip$/)) {
$hasCU = 1;
elsif ((($arg =~ /\.cu$/ or $arg =~ /\.cuh$/) and $HIP_COMPILE_CXX_AS_HIP ne '0') or ($arg =~ /\.hip$/)) {
$needCXXFLAGS = 1;
if ($HIP_PLATFORM eq 'clang') {
$toolArgs .= " -x hip"
if ($HIP_COMPILER eq "clang") {
$hasHIP = 1;
$toolArgs .= " -x hip";
} else {
$hasCU = 1;
}
}
push (@inputs, $arg);
#print "I: <$arg>\n";
}
$toolArgs .= " $arg" unless $swallowArg;
$prevArg = $arg;
}
if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){
@@ -657,9 +706,9 @@ if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){
my $archMacro = ' -D__HIP_ARCH_' . uc($val) . '__=1 ';
# Add the arch option and macro to the compiler options.
$GPU_ARCH_ARG = $GPU_ARCH_OPT . $val;
$HIPLDFLAGS .= $GPU_ARCH_ARG;
$HIPLDARCHFLAGS .= $GPU_ARCH_ARG;
$HIPCXXFLAGS .= $archMacro;
if ($HIP_PLATFORM eq 'clang') {
if ($HIP_PLATFORM eq 'clang' and $hasHIP) {
$HIPCXXFLAGS .= $GPU_ARCH_ARG;
}
@@ -685,7 +734,7 @@ if ($coFormatv3 and $HIP_PLATFORM eq 'hcc') {
$HIPCXXFLAGS .= " -mcode-object-v3";
}
if ($hasC and $HIP_PLATFORM eq 'nvcc') {
if ($hasCXX and $HIP_PLATFORM eq 'nvcc') {
$HIPCXXFLAGS .= " -x cu";
}
if ($hasCU and $HIP_PLATFORM eq 'hcc') {
@@ -694,15 +743,17 @@ if ($hasCU and $HIP_PLATFORM eq 'hcc') {
if ($buildDeps and $HIP_PLATFORM eq 'nvcc') {
$HIPCXXFLAGS .= " -M -D__CUDACC__";
$HIPCFLAGS .= " -M -D__CUDACC__";
}
if ($buildDeps and $HIP_PLATFORM eq 'clang') {
$HIPCXXFLAGS .= " --cuda-host-only";
}
# Add --hip-link only if there are no source files.
if (!$needCXXFLAGS and $HIP_PLATFORM eq 'clang') {
# Add --hip-link only if it is compile only and -fgpu-rdc is on.
if ($rdc and !$compileOnly and $HIP_PLATFORM eq 'clang') {
$HIPLDFLAGS .= " --hip-link";
$HIPLDFLAGS .= $HIPLDARCHFLAGS;
}
if ($setStdLib eq 0 and $HIP_PLATFORM eq 'hcc')
@@ -727,35 +778,55 @@ if ($HIP_PLATFORM eq "clang") {
# Set default optimization level to -O3 for hip-clang.
if ($optArg eq "") {
$HIPCXXFLAGS .= " -O3";
$HIPCFLAGS .= " -O3";
$HIPLDFLAGS .= " -O3";
}
# Do not pass -mllvm on Windows since there is a clang bug causing duplicate -mllvm options in clang -cc1 on Windows.
# ToDo : remove restriction for Windows after clang bug is fixed.
if ($optArg ne "-O0" and not $isWindows) {
if (!$funcSupp and $optArg ne "-O0" and not $isWindows and $hasHIP) {
$HIPCXXFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false";
if ($needLDFLAGS and not $needCXXFLAGS) {
$HIPLDFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false";
}
}
$HIP_DEVLIB_FLAGS = " --hip-device-lib-path=$DEVICE_LIB_PATH";
$HIPCXXFLAGS .= " $HIP_DEVLIB_FLAGS";
if ($hasHIP) {
$HIPCXXFLAGS .= " $HIP_DEVLIB_FLAGS";
if ($HIP_RUNTIME ne "HCC") {
$HIPCXXFLAGS .= " -fhip-new-launch-api";
}
}
if (not $isWindows) {
$HIPLDFLAGS .= " -lgcc_s -lgcc -lpthread -lm";
}
}
if (not $isWindows and not $compileOnly) {
if ($linkType eq 0) {
$toolArgs .= " -L$HIP_LIB_PATH -lamdhip64_static -L$ROCM_PATH/lib -lhsa-runtime64 -ldl ";
} else {
$toolArgs .= " -Wl,--enable-new-dtags -Wl,--rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lhip_hcc ";
}
}
}
if ($HIPCC_COMPILE_FLAGS_APPEND) {
$HIPCXXFLAGS .= " $HIPCC_COMPILE_FLAGS_APPEND";
$HIPCFLAGS .= " $HIPCC_COMPILE_FLAGS_APPEND";
}
if ($HIPCC_LINK_FLAGS_APPEND) {
$HIPLDFLAGS .= " $HIPCC_LINK_FLAGS_APPEND";
}
my $CMD="$HIPCC";
if ($needCFLAGS) {
$CMD .= " $HIPCFLAGS";
}
if ($needCXXFLAGS) {
$CMD .= " $HIPCXXFLAGS";
}
if ($needLDFLAGS and not $compileOnly) {
$CMD .= " $HIPLDFLAGS";
}
@@ -771,6 +842,12 @@ if ($printHipVersion) {
}
print $HIP_VERSION, "\n";
}
if ($printCXXFlags) {
print $HIPCXXFLAGS;
}
if ($printLDFlags) {
print $HIPLDFLAGS;
}
if ($runCmd) {
if ($HIP_PLATFORM eq "hcc" and exists($hipConfig{'HCC_VERSION'}) and $HCC_VERSION ne $hipConfig{'HCC_VERSION'}) {
print ("HIP ($HIP_PATH) was built using hcc $hipConfig{'HCC_VERSION'}, but you are using $HCC_HOME/hcc with version $HCC_VERSION from hipcc. Please rebuild HIP including cmake or update HCC_HOME variable.\n") ;
+62 -16
Voir le fichier
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
$HIP_BASE_VERSION_MAJOR = "3";
$HIP_BASE_VERSION_MINOR = "2";
$HIP_BASE_VERSION_MINOR = "5";
# Need perl > 5.10 to use logic-defined or
use 5.006; use v5.10.1;
@@ -19,6 +19,7 @@ GetOptions(
,"path|p" => \$p_path
,"compiler|c" => \$p_compiler
,"platform|P" => \$p_platform
,"runtime|r" => \$p_runtime
,"cpp_config|cxx_config|C" => \$p_cpp_config
,"full|f|info" => \$p_full,
,"version|v" => \$p_version,
@@ -30,8 +31,9 @@ if ($p_help) {
print "usage: hipconfig [OPTIONS]\n";
print " --path, -p : print HIP_PATH (use env var if set, else determine from hipconfig path)\n";
print " --cpp_config, -C : print C++ compiler options\n";
print " --compiler, -c : print compiler (hcc or nvcc)\n";
print " --compiler, -c : print compiler (hcc or clang or nvcc)\n";
print " --platform, -P : print platform (hcc or nvcc)\n";
print " --runtime, -r : print runtime (HCC or VDI)\n";
print " --full, -f : print full config\n";
print " --version, -v : print hip version\n";
print " --check : check configuration\n";
@@ -82,13 +84,22 @@ if (-e "$HIP_PATH/../.info/version") {
$CUDA_PATH=$ENV{'CUDA_PATH'} // '/usr/local/cuda';
$HCC_HOME=$ENV{'HCC_HOME'} // "$ROCM_PATH/hcc";
$HSA_PATH=$ENV{'HSA_PATH'} // "$ROCM_PATH/hsa";
$HIP_CLANG_PATH=$ENV{'HIP_CLANG_PATH'} // "$ROCM_PATH/llvm/bin";
#---
#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
$HIP_PLATFORM=$ENV{'HIP_PLATFORM'};
# Read .hipInfo
my %hipInfo = ();
parse_config_file("$HIP_PATH/lib/.hipInfo", \%hipInfo);
$HIP_COMPILER = $hipInfo{'HIP_COMPILER'} // "hcc";
$HIP_RUNTIME = $hipInfo{'HIP_RUNTIME'} // "HCC";
if (not defined $HIP_PLATFORM) {
if (can_run("$HCC_HOME/bin/hcc") or can_run("hcc")) {
$HIP_PLATFORM = "hcc";
} elsif (can_run("$HIP_CLANG_PATH/clang++") or can_run("clang++")) {
$HIP_PLATFORM = "hcc";
} elsif (can_run("$CUDA_PATH/bin/nvcc") or can_run("nvcc")) {
$HIP_PLATFORM = "nvcc";
} else {
@@ -97,8 +108,15 @@ if (not defined $HIP_PLATFORM) {
}
}
if ($HIP_PLATFORM eq "hcc") {
$CPP_CONFIG= " -D__HIP_PLATFORM_HCC__= -I$HIP_PATH/include -I$HCC_HOME/include -I$HSA_PATH/include";
if ($HIP_COMPILER eq "hcc") {
$CPP_CONFIG= " -D__HIP_PLATFORM_HCC__= -I$HIP_PATH/include -I$HCC_HOME/include -I$HSA_PATH/include";
}
if ($HIP_COMPILER eq "clang") {
$HIP_CLANG_VERSION = `$HIP_CLANG_PATH/clang++ --version`;
$HIP_CLANG_VERSION=~/.*clang version ([^ ]+).*/;
$HIP_CLANG_VERSION=$1;
$CPP_CONFIG= " -D__HIP_PLATFORM_HCC__= -I$HIP_PATH/include -I$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION -I$HSA_PATH/include";
}
if ($HIP_PLATFORM eq "nvcc") {
$CPP_CONFIG = " -D__HIP_PLATFORM_NVCC__= -I$HIP_PATH/include -I$CUDA_PATH/include";
@@ -118,18 +136,26 @@ if ($p_path) {
$printed = 1;
}
if ($p_cpp_config) {
print $CPP_CONFIG;
$printed = 1;
}
if ($p_compiler) {
print $HIP_COMPILER;
$printed = 1;
}
if ($p_compiler or $p_platform) {
if ($p_platform) {
print $HIP_PLATFORM;
$printed = 1;
}
if ($p_runtime) {
print $HIP_RUNTIME;
$printed = 1;
}
if ($p_version) {
print $HIP_VERSION;
$printed = 1;
@@ -139,21 +165,41 @@ if (!$printed or $p_full) {
print "HIP version : ", $HIP_VERSION, "\n\n";
print "== hipconfig\n";
print "HIP_PATH : ", $HIP_PATH, "\n";
print "HIP_COMPILER : ", $HIP_COMPILER, "\n";
print "HIP_PLATFORM : ", $HIP_PLATFORM, "\n";
print "HIP_RUNTIME : ", $HIP_RUNTIME, "\n";
print "CPP_CONFIG : ", $CPP_CONFIG, "\n";
if ($HIP_PLATFORM eq "hcc")
{
print "\n" ;
print "== hcc\n";
print ("HSA_PATH : $HSA_PATH\n");
print ("HCC_HOME : $HCC_HOME\n");
system("$HCC_HOME/bin/hcc --version");
system("$HCC_HOME/bin/llc --version");
print ("HCC-cxxflags : ");
system("$HCC_HOME/bin/hcc-config --cxxflags");
print ("HCC-ldflags : ");
system("$HCC_HOME/bin/hcc-config --ldflags");
printf("\n");
if ($HIP_COMPILER eq "hcc")
{
print "== hcc\n";
print ("HSA_PATH : $HSA_PATH\n");
print ("HCC_HOME : $HCC_HOME\n");
system("$HCC_HOME/bin/hcc --version");
system("$HCC_HOME/bin/llc --version");
print ("HCC-cxxflags : ");
system("$HCC_HOME/bin/hcc-config --cxxflags");
printf("\n");
print ("HCC-ldflags : ");
system("$HCC_HOME/bin/hcc-config --ldflags");
printf("\n");
}
if ($HIP_COMPILER eq "clang")
{
print "== hip-clang\n";
print ("HSA_PATH : $HSA_PATH\n");
print ("HIP_CLANG_PATH : $HIP_CLANG_PATH\n");
system("$HIP_CLANG_PATH/clang++ --version");
system("$HIP_CLANG_PATH/llc --version");
print ("hip-clang-cxxflags : ");
system("$HIP_PATH/bin/hipcc --cxxflags");
printf("\n");
print ("hip-clang-ldflags : ");
system("$HIP_PATH/bin/hipcc --ldflags");
printf("\n");
}
}
if ($HIP_PLATFORM eq "nvcc") {
print "\n" ;
+48 -2
Voir le fichier
@@ -341,8 +341,8 @@ sub simpleSubstitutions {
$ft{'execution'} += s/\bcudaLaunchCooperativeKernelMultiDevice\b/hipLaunchCooperativeKernelMultiDevice/g;
$ft{'execution'} += s/\bcudaLaunchKernel\b/hipLaunchKernel/g;
$ft{'execution'} += s/\bcudaSetupArgument\b/hipSetupArgument/g;
$ft{'occupancy'} += s/\bcuOccupancyMaxActiveBlocksPerMultiprocessor\b/hipOccupancyMaxActiveBlocksPerMultiprocessor/g;
$ft{'occupancy'} += s/\bcuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags\b/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags/g;
$ft{'occupancy'} += s/\bcuOccupancyMaxActiveBlocksPerMultiprocessor\b/hipDrvOccupancyMaxActiveBlocksPerMultiprocessor/g;
$ft{'occupancy'} += s/\bcuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags\b/hipDrvOccupancyMaxActiveBlocksPerMultiprocessorWithFlags/g;
$ft{'occupancy'} += s/\bcuOccupancyMaxPotentialBlockSize\b/hipOccupancyMaxPotentialBlockSize/g;
$ft{'occupancy'} += s/\bcudaOccupancyMaxActiveBlocksPerMultiprocessor\b/hipOccupancyMaxActiveBlocksPerMultiprocessor/g;
$ft{'occupancy'} += s/\bcudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags\b/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags/g;
@@ -742,8 +742,12 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcurandSetQuasiRandomGeneratorDimensions\b/hiprandSetQuasiRandomGeneratorDimensions/g;
$ft{'library'} += s/\bcurandSetStream\b/hiprandSetStream/g;
$ft{'library'} += s/\bcusparseCaxpyi\b/hipsparseCaxpyi/g;
$ft{'library'} += s/\bcusparseCbsrmv\b/hipsparseCbsrmv/g;
$ft{'library'} += s/\bcusparseCcsr2csc\b/hipsparseCcsr2csc/g;
$ft{'library'} += s/\bcusparseCcsr2hyb\b/hipsparseCcsr2hyb/g;
$ft{'library'} += s/\bcusparseCcsrgeam\b/hipsparseCcsrgeam/g;
$ft{'library'} += s/\bcusparseCcsrgeam2\b/hipsparseCcsrgeam2/g;
$ft{'library'} += s/\bcusparseCcsrgeam2_bufferSizeExt\b/hipsparseCcsrgeam2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseCcsrgemm\b/hipsparseCcsrgemm/g;
$ft{'library'} += s/\bcusparseCcsrgemm2\b/hipsparseCcsrgemm2/g;
$ft{'library'} += s/\bcusparseCcsrgemm2_bufferSizeExt\b/hipsparseCcsrgemm2_bufferSizeExt/g;
@@ -754,6 +758,9 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseCcsrmm\b/hipsparseCcsrmm/g;
$ft{'library'} += s/\bcusparseCcsrmm2\b/hipsparseCcsrmm2/g;
$ft{'library'} += s/\bcusparseCcsrmv\b/hipsparseCcsrmv/g;
$ft{'library'} += s/\bcusparseCcsrsm2_analysis\b/hipsparseCcsrsm2_analysis/g;
$ft{'library'} += s/\bcusparseCcsrsm2_bufferSizeExt\b/hipsparseCcsrsm2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseCcsrsm_solve\b/hipsparseCcsrsm_solve/g;
$ft{'library'} += s/\bcusparseCcsrsv2_analysis\b/hipsparseCcsrsv2_analysis/g;
$ft{'library'} += s/\bcusparseCcsrsv2_bufferSize\b/hipsparseCcsrsv2_bufferSize/g;
$ft{'library'} += s/\bcusparseCcsrsv2_bufferSizeExt\b/hipsparseCcsrsv2_bufferSizeExt/g;
@@ -763,17 +770,24 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseCgthr\b/hipsparseCgthr/g;
$ft{'library'} += s/\bcusparseCgthrz\b/hipsparseCgthrz/g;
$ft{'library'} += s/\bcusparseChybmv\b/hipsparseChybmv/g;
$ft{'library'} += s/\bcusparseCnnz\b/hipsparseCnnz/g;
$ft{'library'} += s/\bcusparseCnnz_compress\b/hipsparseCnnz_compress/g;
$ft{'library'} += s/\bcusparseCreate\b/hipsparseCreate/g;
$ft{'library'} += s/\bcusparseCreateCsrgemm2Info\b/hipsparseCreateCsrgemm2Info/g;
$ft{'library'} += s/\bcusparseCreateCsrilu02Info\b/hipsparseCreateCsrilu02Info/g;
$ft{'library'} += s/\bcusparseCreateCsrsm2Info\b/hipsparseCreateCsrsm2Info/g;
$ft{'library'} += s/\bcusparseCreateCsrsv2Info\b/hipsparseCreateCsrsv2Info/g;
$ft{'library'} += s/\bcusparseCreateHybMat\b/hipsparseCreateHybMat/g;
$ft{'library'} += s/\bcusparseCreateIdentityPermutation\b/hipsparseCreateIdentityPermutation/g;
$ft{'library'} += s/\bcusparseCreateMatDescr\b/hipsparseCreateMatDescr/g;
$ft{'library'} += s/\bcusparseCsctr\b/hipsparseCsctr/g;
$ft{'library'} += s/\bcusparseDaxpyi\b/hipsparseDaxpyi/g;
$ft{'library'} += s/\bcusparseDbsrmv\b/hipsparseDbsrmv/g;
$ft{'library'} += s/\bcusparseDcsr2csc\b/hipsparseDcsr2csc/g;
$ft{'library'} += s/\bcusparseDcsr2hyb\b/hipsparseDcsr2hyb/g;
$ft{'library'} += s/\bcusparseDcsrgeam\b/hipsparseDcsrgeam/g;
$ft{'library'} += s/\bcusparseDcsrgeam2\b/hipsparseDcsrgeam2/g;
$ft{'library'} += s/\bcusparseDcsrgeam2_bufferSizeExt\b/hipsparseDcsrgeam2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseDcsrgemm\b/hipsparseDcsrgemm/g;
$ft{'library'} += s/\bcusparseDcsrgemm2\b/hipsparseDcsrgemm2/g;
$ft{'library'} += s/\bcusparseDcsrgemm2_bufferSizeExt\b/hipsparseDcsrgemm2_bufferSizeExt/g;
@@ -784,6 +798,9 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseDcsrmm\b/hipsparseDcsrmm/g;
$ft{'library'} += s/\bcusparseDcsrmm2\b/hipsparseDcsrmm2/g;
$ft{'library'} += s/\bcusparseDcsrmv\b/hipsparseDcsrmv/g;
$ft{'library'} += s/\bcusparseDcsrsm2_analysis\b/hipsparseDcsrsm2_analysis/g;
$ft{'library'} += s/\bcusparseDcsrsm2_bufferSizeExt\b/hipsparseDcsrsm2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseDcsrsm_solve\b/hipsparseDcsrsm_solve/g;
$ft{'library'} += s/\bcusparseDcsrsv2_analysis\b/hipsparseDcsrsv2_analysis/g;
$ft{'library'} += s/\bcusparseDcsrsv2_bufferSize\b/hipsparseDcsrsv2_bufferSize/g;
$ft{'library'} += s/\bcusparseDcsrsv2_bufferSizeExt\b/hipsparseDcsrsv2_bufferSizeExt/g;
@@ -792,12 +809,15 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseDestroy\b/hipsparseDestroy/g;
$ft{'library'} += s/\bcusparseDestroyCsrgemm2Info\b/hipsparseDestroyCsrgemm2Info/g;
$ft{'library'} += s/\bcusparseDestroyCsrilu02Info\b/hipsparseDestroyCsrilu02Info/g;
$ft{'library'} += s/\bcusparseDestroyCsrsm2Info\b/hipsparseDestroyCsrsm2Info/g;
$ft{'library'} += s/\bcusparseDestroyCsrsv2Info\b/hipsparseDestroyCsrsv2Info/g;
$ft{'library'} += s/\bcusparseDestroyHybMat\b/hipsparseDestroyHybMat/g;
$ft{'library'} += s/\bcusparseDestroyMatDescr\b/hipsparseDestroyMatDescr/g;
$ft{'library'} += s/\bcusparseDgthr\b/hipsparseDgthr/g;
$ft{'library'} += s/\bcusparseDgthrz\b/hipsparseDgthrz/g;
$ft{'library'} += s/\bcusparseDhybmv\b/hipsparseDhybmv/g;
$ft{'library'} += s/\bcusparseDnnz\b/hipsparseDnnz/g;
$ft{'library'} += s/\bcusparseDnnz_compress\b/hipsparseDnnz_compress/g;
$ft{'library'} += s/\bcusparseDroti\b/hipsparseDroti/g;
$ft{'library'} += s/\bcusparseDsctr\b/hipsparseDsctr/g;
$ft{'library'} += s/\bcusparseGetMatDiagType\b/hipsparseGetMatDiagType/g;
@@ -808,8 +828,12 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseGetStream\b/hipsparseGetStream/g;
$ft{'library'} += s/\bcusparseGetVersion\b/hipsparseGetVersion/g;
$ft{'library'} += s/\bcusparseSaxpyi\b/hipsparseSaxpyi/g;
$ft{'library'} += s/\bcusparseSbsrmv\b/hipsparseSbsrmv/g;
$ft{'library'} += s/\bcusparseScsr2csc\b/hipsparseScsr2csc/g;
$ft{'library'} += s/\bcusparseScsr2hyb\b/hipsparseScsr2hyb/g;
$ft{'library'} += s/\bcusparseScsrgeam\b/hipsparseScsrgeam/g;
$ft{'library'} += s/\bcusparseScsrgeam2\b/hipsparseScsrgeam2/g;
$ft{'library'} += s/\bcusparseScsrgeam2_bufferSizeExt\b/hipsparseScsrgeam2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseScsrgemm\b/hipsparseScsrgemm/g;
$ft{'library'} += s/\bcusparseScsrgemm2\b/hipsparseScsrgemm2/g;
$ft{'library'} += s/\bcusparseScsrgemm2_bufferSizeExt\b/hipsparseScsrgemm2_bufferSizeExt/g;
@@ -820,6 +844,9 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseScsrmm\b/hipsparseScsrmm/g;
$ft{'library'} += s/\bcusparseScsrmm2\b/hipsparseScsrmm2/g;
$ft{'library'} += s/\bcusparseScsrmv\b/hipsparseScsrmv/g;
$ft{'library'} += s/\bcusparseScsrsm2_analysis\b/hipsparseScsrsm2_analysis/g;
$ft{'library'} += s/\bcusparseScsrsm2_bufferSizeExt\b/hipsparseScsrsm2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseScsrsm_solve\b/hipsparseScsrsm_solve/g;
$ft{'library'} += s/\bcusparseScsrsv2_analysis\b/hipsparseScsrsv2_analysis/g;
$ft{'library'} += s/\bcusparseScsrsv2_bufferSize\b/hipsparseScsrsv2_bufferSize/g;
$ft{'library'} += s/\bcusparseScsrsv2_bufferSizeExt\b/hipsparseScsrsv2_bufferSizeExt/g;
@@ -834,6 +861,8 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseSgthr\b/hipsparseSgthr/g;
$ft{'library'} += s/\bcusparseSgthrz\b/hipsparseSgthrz/g;
$ft{'library'} += s/\bcusparseShybmv\b/hipsparseShybmv/g;
$ft{'library'} += s/\bcusparseSnnz\b/hipsparseSnnz/g;
$ft{'library'} += s/\bcusparseSnnz_compress\b/hipsparseSnnz_compress/g;
$ft{'library'} += s/\bcusparseSroti\b/hipsparseSroti/g;
$ft{'library'} += s/\bcusparseSsctr\b/hipsparseSsctr/g;
$ft{'library'} += s/\bcusparseXbsrilu02_zeroPivot\b/hipsparseXbsrilu02_zeroPivot/g;
@@ -844,15 +873,22 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseXcscsort\b/hipsparseXcscsort/g;
$ft{'library'} += s/\bcusparseXcscsort_bufferSizeExt\b/hipsparseXcscsort_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseXcsr2coo\b/hipsparseXcsr2coo/g;
$ft{'library'} += s/\bcusparseXcsrgeam2Nnz\b/hipsparseXcsrgeam2Nnz/g;
$ft{'library'} += s/\bcusparseXcsrgeamNnz\b/hipsparseXcsrgeamNnz/g;
$ft{'library'} += s/\bcusparseXcsrgemm2Nnz\b/hipsparseXcsrgemm2Nnz/g;
$ft{'library'} += s/\bcusparseXcsrgemmNnz\b/hipsparseXcsrgemmNnz/g;
$ft{'library'} += s/\bcusparseXcsrilu02_zeroPivot\b/hipsparseXcsrilu02_zeroPivot/g;
$ft{'library'} += s/\bcusparseXcsrsm2_zeroPivot\b/hipsparseXcsrsm2_zeroPivot/g;
$ft{'library'} += s/\bcusparseXcsrsort\b/hipsparseXcsrsort/g;
$ft{'library'} += s/\bcusparseXcsrsort_bufferSizeExt\b/hipsparseXcsrsort_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseXcsrsv2_zeroPivot\b/hipsparseXcsrsv2_zeroPivot/g;
$ft{'library'} += s/\bcusparseZaxpyi\b/hipsparseZaxpyi/g;
$ft{'library'} += s/\bcusparseZbsrmv\b/hipsparseZbsrmv/g;
$ft{'library'} += s/\bcusparseZcsr2csc\b/hipsparseZcsr2csc/g;
$ft{'library'} += s/\bcusparseZcsr2hyb\b/hipsparseZcsr2hyb/g;
$ft{'library'} += s/\bcusparseZcsrgeam\b/hipsparseZcsrgeam/g;
$ft{'library'} += s/\bcusparseZcsrgeam2\b/hipsparseZcsrgeam2/g;
$ft{'library'} += s/\bcusparseZcsrgeam2_bufferSizeExt\b/hipsparseZcsrgeam2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseZcsrgemm\b/hipsparseZcsrgemm/g;
$ft{'library'} += s/\bcusparseZcsrgemm2\b/hipsparseZcsrgemm2/g;
$ft{'library'} += s/\bcusparseZcsrgemm2_bufferSizeExt\b/hipsparseZcsrgemm2_bufferSizeExt/g;
@@ -863,6 +899,9 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseZcsrmm\b/hipsparseZcsrmm/g;
$ft{'library'} += s/\bcusparseZcsrmm2\b/hipsparseZcsrmm2/g;
$ft{'library'} += s/\bcusparseZcsrmv\b/hipsparseZcsrmv/g;
$ft{'library'} += s/\bcusparseZcsrsm2_analysis\b/hipsparseZcsrsm2_analysis/g;
$ft{'library'} += s/\bcusparseZcsrsm2_bufferSizeExt\b/hipsparseZcsrsm2_bufferSizeExt/g;
$ft{'library'} += s/\bcusparseZcsrsm_solve\b/hipsparseZcsrsm_solve/g;
$ft{'library'} += s/\bcusparseZcsrsv2_analysis\b/hipsparseZcsrsv2_analysis/g;
$ft{'library'} += s/\bcusparseZcsrsv2_bufferSize\b/hipsparseZcsrsv2_bufferSize/g;
$ft{'library'} += s/\bcusparseZcsrsv2_bufferSizeExt\b/hipsparseZcsrsv2_bufferSizeExt/g;
@@ -872,6 +911,8 @@ sub simpleSubstitutions {
$ft{'library'} += s/\bcusparseZgthr\b/hipsparseZgthr/g;
$ft{'library'} += s/\bcusparseZgthrz\b/hipsparseZgthrz/g;
$ft{'library'} += s/\bcusparseZhybmv\b/hipsparseZhybmv/g;
$ft{'library'} += s/\bcusparseZnnz\b/hipsparseZnnz/g;
$ft{'library'} += s/\bcusparseZnnz_compress\b/hipsparseZnnz_compress/g;
$ft{'library'} += s/\bcusparseZsctr\b/hipsparseZsctr/g;
$ft{'device_library'} += s/\bcurand\b/hiprand/g;
$ft{'device_library'} += s/\bcurand_discrete\b/hiprand_discrete/g;
@@ -997,6 +1038,8 @@ sub simpleSubstitutions {
$ft{'type'} += s/\bcsrgemm2Info\b/csrgemm2Info/g;
$ft{'type'} += s/\bcsrgemm2Info_t\b/csrgemm2Info_t/g;
$ft{'type'} += s/\bcsrilu02Info_t\b/csrilu02Info_t/g;
$ft{'type'} += s/\bcsrsm2Info\b/csrsm2Info/g;
$ft{'type'} += s/\bcsrsm2Info_t\b/csrsm2Info_t/g;
$ft{'type'} += s/\bcsrsv2Info_t\b/csrsv2Info_t/g;
$ft{'type'} += s/\bcuComplex\b/hipComplex/g;
$ft{'type'} += s/\bcuDoubleComplex\b/hipDoubleComplex/g;
@@ -1130,6 +1173,7 @@ sub simpleSubstitutions {
$ft{'type'} += s/\bcurandStatus_t\b/hiprandStatus_t/g;
$ft{'type'} += s/\bcusparseAction_t\b/hipsparseAction_t/g;
$ft{'type'} += s/\bcusparseDiagType_t\b/hipsparseDiagType_t/g;
$ft{'type'} += s/\bcusparseDirection_t\b/hipsparseDirection_t/g;
$ft{'type'} += s/\bcusparseFillMode_t\b/hipsparseFillMode_t/g;
$ft{'type'} += s/\bcusparseHandle_t\b/hipsparseHandle_t/g;
$ft{'type'} += s/\bcusparseHybMat_t\b/hipsparseHybMat_t/g;
@@ -1398,6 +1442,8 @@ sub simpleSubstitutions {
$ft{'numeric_literal'} += s/\bCUSPARSE_ACTION_SYMBOLIC\b/HIPSPARSE_ACTION_SYMBOLIC/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_DIAG_TYPE_NON_UNIT\b/HIPSPARSE_DIAG_TYPE_NON_UNIT/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_DIAG_TYPE_UNIT\b/HIPSPARSE_DIAG_TYPE_UNIT/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_DIRECTION_COLUMN\b/HIPSPARSE_DIRECTION_COLUMN/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_DIRECTION_ROW\b/HIPSPARSE_DIRECTION_ROW/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_FILL_MODE_LOWER\b/HIPSPARSE_FILL_MODE_LOWER/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_FILL_MODE_UPPER\b/HIPSPARSE_FILL_MODE_UPPER/g;
$ft{'numeric_literal'} += s/\bCUSPARSE_HYB_PARTITION_AUTO\b/HIPSPARSE_HYB_PARTITION_AUTO/g;