From ed40ee2083daa7c49c5fe84c413dd9f06eb640a2 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Mon, 11 Jul 2016 16:38:41 +0530 Subject: [PATCH] Move hip version information to hipconfig Change-Id: I2892a9eb9356ac5310b89a433d858c1c3eb986ee [ROCm/hip commit: 3cbbcc30f96e39edf2d8938073c031d664afea5c] --- projects/hip/bin/hipcc | 7 ++----- projects/hip/bin/hipconfig | 14 +++++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 2c95a21a99..984030adfb 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -24,10 +24,6 @@ print "No Arguments passed, exiting ...\n"; exit(-1); } -$HIP_VERSION_MAJOR = "0"; -$HIP_VERSION_MINOR = "90"; -$HIP_VERSION_PATCH = "0"; - $verbose = $ENV{'HIPCC_VERBOSE'}; $verbose = 0 unless defined $verbose; # Verbose: 0x1=commands, 0x2=paths, 0x4=hippc args @@ -45,6 +41,7 @@ $marker_path = "$CODEXL_PATH/SDK/AMDTActivityLogger"; #--- #HIP_PLATFORM controls whether to use NVCC or HCC for compilation: $HIP_PLATFORM= `$HIP_PATH/bin/hipconfig --platform`; +$HIP_VERSION= `$HIP_PATH/bin/hipconfig --version`; $HIP_PLATFORM="hcc" unless defined $HIP_PLATFORM; @@ -250,7 +247,7 @@ if ($printHipVersion) { if ($runCmd) { print "HIP version: " } - print $HIP_VERSION_MAJOR, ".", $HIP_VERSION_MINOR, ".", $HIP_VERSION_PATCH, "\n"; + print $HIP_VERSION, "\n"; } if ($runCmd) { system ("$CMD") and die (); diff --git a/projects/hip/bin/hipconfig b/projects/hip/bin/hipconfig index 49c385753d..4f4559cb8e 100755 --- a/projects/hip/bin/hipconfig +++ b/projects/hip/bin/hipconfig @@ -1,4 +1,9 @@ #!/usr/bin/perl -w + +$HIP_VERSION_MAJOR = "0"; +$HIP_VERSION_MINOR = "90"; +$HIP_VERSION_PATCH = "0"; + use Getopt::Long; use Cwd; @@ -15,6 +20,7 @@ GetOptions( ,"platform|P" => \$p_platform ,"cpp_config|cxx_config|C" => \$p_cpp_config ,"full|f|info" => \$p_full, + ,"version|v" => \$p_version, ,"check" => \$p_check, ,"newline|n" => \$p_newline ); @@ -26,12 +32,14 @@ if ($p_help) { print " --compiler, -c : print compiler (hcc or nvcc)\n"; print " --platform, -P : print platform (hcc or nvcc)\n"; print " --full, -f : print full config\n"; + print " --version, -v : print hip version\n"; print " --check : check configuration\n"; print " --newline, -n : print newline\n"; print " --help, -h : print help message\n"; exit(); } +$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH"; $CUDA_PATH=$ENV{'CUDA_PATH'}; $CUDA_PATH='/usr/local/cuda' unless defined $CUDA_PATH; @@ -83,9 +91,13 @@ if ($p_compiler or $p_platform) { $printed = 1; } - +if ($p_version) { + print $HIP_VERSION; + $printed = 1; +} if (!$printed or $p_full) { + print "HIP version : ", $HIP_VERSION, "\n\n"; print "== hipconfig\n"; print "HIP_PATH : ", $HIP_PATH, "\n"; print "HIP_PLATFORM : ", $HIP_PLATFORM, "\n";