From 6df2a2d8c396fcb5c454872ef255443c20d181b3 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Wed, 31 Aug 2016 20:36:36 -0500 Subject: [PATCH] added device code offline compilation for nvcc Change-Id: I1f77131778b4dcfcf720b4367dd9f18ffaf1cbb3 [ROCm/hip commit: 6a6a0ae32f2d9d194c20ea5de75e59d4195634c2] --- projects/hip/bin/hipcc | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 946f5abe68..3a9275de51 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -157,16 +157,30 @@ if ($HIP_PLATFORM eq "hcc") { exit (-1); } + my $ISACMD=$HIP_PATH; -$ISACMD .= "/bin/hipgenisa.sh "; -$ISACMD .= $ROCM_PATH; -if($ARGV[0] eq "--genisa"){ - foreach $isaarg (@ARGV){ - $ISACMD .= " "; - $ISACMD .= $isaarg; +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 .= $isarg; + } + system($ISACMD); + exit(0); } - system($ISACMD); - exit(0); } # Add paths to common HIP includes: