From 1afa3d021b4ec90d6f69fb7ef76f16933c798cc6 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 15 Mar 2017 12:03:05 +0530 Subject: [PATCH] hipcc: Fix warning when HCC_AMDGPU_TARGET is not defined Change-Id: I5cc6b0e9fb23ec78152d8bcfe9e7511e2fe91055 [ROCm/hip commit: 4ae1ea8143615023f48ca4b6cbad30a275866c22] --- projects/hip/bin/hipcc | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index d2822fd0da..381c774c94 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -326,27 +326,30 @@ foreach $arg (@ARGV) } $toolArgs .= " $arg" unless $swallowArg; } -foreach my $target (split(/,/, $ENV{HCC_AMDGPU_TARGET})) +if(defined $ENV{HCC_AMDGPU_TARGET}) { - if($target eq 'gfx701') + foreach my $target (split(/,/, $ENV{HCC_AMDGPU_TARGET})) { - $target_gfx701 = 1; - } - if($target eq 'gfx801') - { - $target_gfx801 = 1; - } - if($target eq 'gfx802') - { - $target_gfx802 = 1; - } - if($target eq 'gfx803') - { - $target_gfx803 = 1; - } - if($target eq 'gfx900') - { - $target_gfx900 = 1; + if($target eq 'gfx701') + { + $target_gfx701 = 1; + } + if($target eq 'gfx801') + { + $target_gfx801 = 1; + } + if($target eq 'gfx802') + { + $target_gfx802 = 1; + } + if($target eq 'gfx803') + { + $target_gfx803 = 1; + } + if($target eq 'gfx900') + { + $target_gfx900 = 1; + } } } if ($target_gfx701 eq 0 and $target_gfx801 eq 0 and $target_gfx802 eq 0 and $target_gfx803 eq 0 and $target_gfx900 eq 0)