From 6a2e92f7c8dfba94f89c83cd869ebd68340cc832 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 3 Aug 2016 12:01:48 +0530 Subject: [PATCH] .hipconfig now lives in lib Also moved reading .hipconfig to begining of hipcc Change-Id: Ibb9d32bef64a79f189aa037c36814759c8cc8052 --- hipamd/CMakeLists.txt | 2 +- hipamd/bin/hipcc | 37 +++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt index 08e59ba32b..a26e848985 100644 --- a/hipamd/CMakeLists.txt +++ b/hipamd/CMakeLists.txt @@ -172,7 +172,7 @@ if(HIP_PLATFORM STREQUAL "hcc") endif() # Install .hipconfig - install(FILES ${PROJECT_BINARY_DIR}/.hipconfig DESTINATION bin) + install(FILES ${PROJECT_BINARY_DIR}/.hipconfig DESTINATION lib) endif() # Install src, bin, include if necessary diff --git a/hipamd/bin/hipcc b/hipamd/bin/hipcc index d1f757d0c4..1141e1c08d 100755 --- a/hipamd/bin/hipcc +++ b/hipamd/bin/hipcc @@ -31,6 +31,25 @@ $verbose = 0 unless defined $verbose; $HIP_PATH=$ENV{'HIP_PATH'}; $HIP_PATH=dirname (dirname $0) unless defined $HIP_PATH; # use parent directory of hipcc +#--- +# Read .hipconfig +my %hipConfig = (); +$hipConfig{'VALID'}=0; +if (open (CONFIG, "$HIP_PATH/lib/.hipconfig")) { + while () { + my $config_line=$_; + chop ($config_line); + $config_line =~ s/^\s*//; + $config_line =~ s/\s*$//; + if (($config_line !~ /^#/) && ($config_line ne "")) { + my ($name, $value) = split (/=/, $config_line); + $hipConfig{$name} = $value; + $hipConfig{'VALID'}=1; + } + } + close(CONFIG); +} + #--- #HIP_PLATFORM controls whether to use NVCC or HCC for compilation: $HIP_PLATFORM= `$HIP_PATH/bin/hipconfig --platform`; @@ -241,24 +260,6 @@ if ($needHipHcc) { } } -# Read .hipconfig -my %hipConfig = (); -$hipConfig{'VALID'}=0; -if (open (CONFIG, "$HIP_PATH/bin/.hipconfig")) { - while () { - my $config_line=$_; - chop ($config_line); - $config_line =~ s/^\s*//; - $config_line =~ s/\s*$//; - if (($config_line !~ /^#/) && ($config_line ne "")) { - my ($name, $value) = split (/=/, $config_line); - $hipConfig{$name} = $value; - $hipConfig{'VALID'}=1; - } - } - close(CONFIG); -} - # hipcc currrently requires separate compilation of source files, ie it is not possible to pass # CPP files combined with .O files # Reason is that NVCC uses the file extension to determine whether to compile in CUDA mode or