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