added kernel only compilation feature for hipcc

1. Added hipgenisa.sh file to compile kernel code to hsa code object
2. Changed hipcc to call hipgenisa.sh, making hipcc compiling the kernels

Change-Id: I976459c1ebb24343e1b1fe38b4c3a203f1adffa9
This commit is contained in:
Aditya Atluri
2016-08-31 13:05:57 -05:00
orang tua 6bfbf17fb6
melakukan 2f8b2fca6b
2 mengubah file dengan 37 tambahan dan 0 penghapusan
+11
Melihat File
@@ -157,6 +157,16 @@ if ($HIP_PLATFORM eq "hcc") {
exit (-1);
}
my $ISACMD="hipgenisa.sh ";
$ISACMD .= $ROCM_PATH;
if($ARGV[0] eq "--genisa"){
foreach $isaarg (@ARGV){
$ISACMD .= " ";
$ISACMD .= $isaarg;
}
system($ISACMD);
exit(-1);
}
# Add paths to common HIP includes:
$HIPCXXFLAGS .= " -I$HIP_PATH/include" ;
@@ -178,6 +188,7 @@ if ($verbose & 0x4) {
}
my $toolArgs = ""; # arguments to pass to the hcc or nvcc tool
foreach $arg (@ARGV)
{
my $swallowArg = 0;
+26
Melihat File
@@ -0,0 +1,26 @@
#!/bin/bash
if [ $1 = " " ]
then
exit
fi
ROCM_PATH=$1
GEN_ISA=$3
FILE_NAMES=$4
OUT=$5
OUTPUT_FILE=$6
TARGET=""
if [ ${GEN_ISA:0:12} = "--target-isa" ]
then
TARGET=${GEN_ISA:13:12}
fi
export KMDUMPISA=1
export KMDUMPLLVM=1
hipcc $FILE_NAMES -o /tmp/hipgenisa/a.out
mv dump.* /tmp/hipgenisa/
${ROCM_PATH}/hcc-lc/bin/llvm-mc -arch=amdgcn -mcpu=$TARGET -filetype=obj /tmp/hipgenisa/dump.isa -o /tmp/hipgenisa/dump.o
${ROCM_PATH}/llvm/bin/clang -target amdgcn--amdhsa /tmp/hipgenisa/dump.o -o $OUTPUT_FILE
export KMDUMPISA=0
export KMDUMPLLVM=0