Skip to content

Commit

Permalink
Merge pull request llvm#127 from ROCm-Developer-Tools/amd/dev/kzhurav…
Browse files Browse the repository at this point in the history
…l/fix-hipcc-psdb

[fix] Add '-x cu' for c++ file extensions
  • Loading branch information
kzhuravl committed Aug 2, 2023
2 parents 2758d91 + 3800dbd commit a118509
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions amd/hipcc/bin/hipcc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ sub get_normalized_path {
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)
my $hasHIP = 0; # options contain a hip-style file (HIP-Clang must pass offloading options)
my $printHipVersion = 0; # print HIP version
my $printCXXFlags = 0; # print HIPCXXFLAGS
Expand Down Expand Up @@ -441,6 +440,9 @@ sub get_normalized_path {
$needCXXFLAGS = 1;
if ($HIP_COMPILE_CXX_AS_HIP eq '0' or $HIP_PLATFORM ne "amd" or $hasOMPTargets eq 1) {
$hasCXX = 1;
if ($HIP_PLATFORM eq "nvidia") {
$toolArgs .= " -x cu";
}
} elsif ($HIP_PLATFORM eq "amd") {
$hasHIP = 1;
$toolArgs .= " -x hip";
Expand All @@ -451,7 +453,6 @@ sub get_normalized_path {
$hasHIP = 1;
$toolArgs .= " -x hip";
} elsif ($HIP_PLATFORM eq "nvidia") {
$hasCU = 1;
$toolArgs .= " -x cu";
}
}
Expand Down

0 comments on commit a118509

Please sign in to comment.