fixed device selection during compilation to use rocm_agent_enumerator

1. Changed hipcc to use rocm_agent_enumerator
2. Changed square sample test to use device variable
This commit is contained in:
Aditya Atluri
2017-07-21 15:50:12 -05:00
committed by Maneesh Gupta
parent c25b9c6786
commit a3bc662c06
2 changed files with 25 additions and 2 deletions
+22
View File
@@ -103,6 +103,28 @@ if ($HIP_PLATFORM eq "hcc") {
$HIPLDFLAGS = `${HCC_HOME}/bin/hcc-config --ldflags`;
$ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
my $myAgents = `${ROCM_AGENT_ENUM} -t GPU`;
my @agentsLine = split('\n', $myAgents);
foreach my $val (@agentsLine) {
if($val eq "gfx701") {
$target_gfx701 = 1;
}
if($val eq "gfx801") {
$target_gfx801 = 1;
}
if($val eq "gfx802") {
$target_gfx802 = 1;
}
if($val eq "gfx803") {
$target_gfx803 = 1;
}
if($val eq "gfx900") {
$target_gfx900 = 1;
}
}
#### GCC system includes workaround ####
$HCC_WA_FLAGS = " ";