From 938502dfcbc2b1972aa018629cf7c7d9092fd03e Mon Sep 17 00:00:00 2001 From: Sarbojit2019 <52527887+SarbojitAMD@users.noreply.github.com> Date: Tue, 20 Aug 2019 17:36:22 +0530 Subject: [PATCH] [hipcc] Fix for uninitialized variables on nvcc path Fixes #1186 --- bin/hipcc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/hipcc b/bin/hipcc index e8bca65663..4be1c084fb 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -107,7 +107,7 @@ $HIP_COMPILER= $hipConfig{'HIP_COMPILER'}; $HIP_RUNTIME= $hipConfig{'HIP_RUNTIME'}; # If using VDI runtime, need to find HIP_VDI_HOME -if ($HIP_RUNTIME eq "VDI" and !defined $HIP_VDI_HOME) { +if (defined $HIP_RUNTIME and $HIP_RUNTIME eq "VDI" and !defined $HIP_VDI_HOME) { my $hipcc_dir = dirname($0); if (-e "$hipcc_dir/../lib/bitcode") { $HIP_VDI_HOME = abs_path($hipcc_dir . "/.."); @@ -133,7 +133,7 @@ if (defined $HIP_VDI_HOME) { } } -if ($HIP_COMPILER eq "clang") { +if (defined $HIP_COMPILER and $HIP_COMPILER eq "clang") { $HIP_PLATFORM = "clang"; if (!defined $HIP_CLANG_PATH) { $HIP_CLANG_PATH = "/opt/rocm/llvm/bin";