From 124e83e37e5333de62e4e6b63cb621f751ba6aaa Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 1 Sep 2016 15:06:36 +0530 Subject: [PATCH] Updates to gencodeobject generation logic - hipcc honors HIPCC_VERBOSE for gencodeobject too - fixed gencodeobject generation logic for nvcc path - hipgenisa.sh is no longer passed the --gencodeobject flag Change-Id: Iab83c18a6decef445fda8468ba5de10cd7935046 [ROCm/hip commit: 14b0fc80c7372a7a74766d3de8a8b3ba2572d66f] --- projects/hip/bin/hipcc | 59 ++++++++++++++++++++--------------- projects/hip/bin/hipgenisa.sh | 8 ++--- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 9429fc611a..8fde7f426d 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -157,32 +157,6 @@ if ($HIP_PLATFORM eq "hcc") { exit (-1); } - -my $ISACMD=$HIP_PATH; -if($HIP_PLATFORM eq "hcc"){ - $ISACMD .= "/bin/hipgenisa.sh "; - $ISACMD .= $ROCM_PATH; - if($ARGV[0] eq "--gencodeobject"){ - foreach $isaarg (@ARGV){ - $ISACMD .= " "; - $ISACMD .= $isaarg; - } - system($ISACMD); - exit(0); - } -} - -if($HIP_PLATFORM eq "nvcc"){ - if($ARGV[0] eq "--gencodeobject"){ - foreach $isaarg (@ARGV){ - $ISACMD .= " "; - $ISACMD .= $isaarg; - } - system($ISACMD); - exit(0); - } -} - # Add paths to common HIP includes: $HIPCXXFLAGS .= " -I$HIP_PATH/include" ; @@ -202,6 +176,39 @@ if ($verbose & 0x4) { print "hipcc-args: ", join (" ", @ARGV), "\n"; } +# Handle code object generation +my $ISACMD=""; +if($HIP_PLATFORM eq "hcc"){ + $ISACMD .= "$HIP_PATH/bin/hipgenisa.sh "; + $ISACMD .= $ROCM_PATH; + if($ARGV[0] eq "--gencodeobject"){ + foreach $isaarg (@ARGV[1..$#ARGV]){ + $ISACMD .= " "; + $ISACMD .= $isaarg; + } + if ($verbose & 0x1) { + print "hipcc-cmd: ", $ISACMD, "\n"; + } + system($ISACMD) and die(); + exit(0); + } +} + +if($HIP_PLATFORM eq "nvcc"){ + $ISACMD .= "$HIP_PATH/bin/hipcc -ptx "; + if($ARGV[0] eq "--gencodeobject"){ + foreach $isaarg (@ARGV[1..$#ARGV]){ + $ISACMD .= " "; + $ISACMD .= $isaarg; + } + if ($verbose & 0x1) { + print "hipcc-cmd: ", $ISACMD, "\n"; + } + system($ISACMD) and die(); + exit(0); + } +} + my $toolArgs = ""; # arguments to pass to the hcc or nvcc tool foreach $arg (@ARGV) diff --git a/projects/hip/bin/hipgenisa.sh b/projects/hip/bin/hipgenisa.sh index 5ccee14a8f..e60abbf78f 100755 --- a/projects/hip/bin/hipgenisa.sh +++ b/projects/hip/bin/hipgenisa.sh @@ -6,10 +6,10 @@ exit fi ROCM_PATH=$1 -GEN_ISA=$3 -FILE_NAMES=$4 -OUT=$5 -OUTPUT_FILE=$6 +GEN_ISA=$2 +FILE_NAMES=$3 +OUT=$4 +OUTPUT_FILE=$5 TARGET="" if [ ${GEN_ISA:0:12} = "--target-isa" ] then