2
0

Improve automated platform detection.

If AMD GPU is installed and detected by driver, default
HIP_PLATFORM to hcc.
Este cometimento está contido em:
Ben Sander
2016-03-25 17:08:34 -05:00
ascendente 814c3d30fc
cometimento 373251aca0
+8 -3
Ver ficheiro
@@ -45,10 +45,15 @@ $HSA_PATH='/opt/hsa' unless defined $HSA_PATH;
#---
#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
$HIP_PLATFORM=$ENV{'HIP_PLATFORM'};
if (not defined $HIP_PLATFORM and (-e "$CUDA_PATH/bin/nvcc")) {
$HIP_PLATFORM="nvcc";
if (not defined $HIP_PLATFORM) {
$NAMDGPUNODES=`cat /sys/class/kfd/kfd/topology/nodes/*/properties 2>/dev/null | grep -c 'simd_count [1-9]'`;
if ($NAMDGPUNODES > 0) {
$HIP_PLATFORM = "hcc"
} else {
$HIP_PLATFORM = "nvcc";
}
}
$HIP_PLATFORM="hcc" unless defined $HIP_PLATFORM;
$HIP_PATH=$ENV{'HIP_PATH'};
$HIP_PATH=Cwd::realpath (dirname (dirname $0)) unless defined $HIP_PATH; # use parent directory of this tool