SWDEV-294226 - Add -x c++ if openmp targets are mentioned (#2363)
Change-Id: Ie15d63eebe2b0b86487ac59845b4fc7f5e5a9e86
[ROCm/hip commit: 63dfe6e8a1]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3d53651d31
Коммит
86a0af8a04
@@ -229,6 +229,7 @@ my $needCXXFLAGS = 0; # need to add CXX flags to compile step
|
||||
my $needCFLAGS = 0; # need to add C flags to compile step
|
||||
my $needLDFLAGS = 1; # need to add LDFLAGS to compile step.
|
||||
my $fileTypeFlag = 0; # to see if -x flag is mentioned
|
||||
my $hasOMPTargets = 0; # If OMP targets is mentioned
|
||||
my $hasC = 0; # options contain a c-style file
|
||||
my $hasCXX = 0; # options contain a cpp-style file (NVCC must force recognition as GPU file)
|
||||
my $hasCU = 0; # options contain a cu-style file (HCC must force recognition as GPU file)
|
||||
@@ -517,6 +518,8 @@ foreach $arg (@ARGV)
|
||||
$hasC = 0;
|
||||
$hasCXX = 0;
|
||||
$hasHIP = 1;
|
||||
} elsif ($arg =~ '-fopenmp-targets=') {
|
||||
$hasOMPTargets = 1;
|
||||
} elsif ($arg =~ m/^-/) {
|
||||
# options start with -
|
||||
if ($arg eq '-fgpu-rdc') {
|
||||
@@ -555,7 +558,7 @@ foreach $arg (@ARGV)
|
||||
$toolArgs .= " -x c";
|
||||
} elsif (($arg =~ /\.cpp$/) or ($arg =~ /\.cxx$/) or ($arg =~ /\.cc$/) or ($arg =~ /\.C$/)) {
|
||||
$needCXXFLAGS = 1;
|
||||
if ($HIP_COMPILE_CXX_AS_HIP eq '0' or $HIP_PLATFORM ne "amd") {
|
||||
if ($HIP_COMPILE_CXX_AS_HIP eq '0' or $HIP_PLATFORM ne "amd" or $hasOMPTargets eq 1) {
|
||||
$hasCXX = 1;
|
||||
} elsif ($HIP_PLATFORM eq "amd") {
|
||||
$hasHIP = 1;
|
||||
|
||||
Ссылка в новой задаче
Block a user