Skip to content

Commit 31d3146

Browse files
committed
[fix][SWDEV-413305][nvcc] Recovering the fallback building of HIP programs via nvcc
[Synopsis] + There is no support for an explicit `-x cu` in hipcc anymore + Thus, the building via `nvcc` relies only on `HIP_PLATFORM`, which should be set to 'nvidia' in order to invoke `nvcc` compilation with implicit providing `-x cu` + But such an implicit setting of `-x cu` never happens + As a result, the compilation via `nvcc` starts actually, but ends up with the following error: `nvcc fatal : Don't know what to do with 'MatrixTranspose.hip'` [Solution] + Not taking into account the excessive variable `$hasCXX` in the condition for an implicit setting of `-x cu` + [Reason] `$hasCXX` is never set for the `nvcc` path [Testing] 1. [Windows + MS cl as host compiler] Steps: - set HIP_PLATFORM=nvidia - set HIP_PATH=<path to ROCM HIP SDK> - set CUDA_PATH=<path to NVIDIA CUDA Toolkit> - set set path=c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\Hostx64\x64\;%path% - perl hipcc.pl MatrixTranspose.hip -o MatrixTranspose -v --gpu-architecture=sm_XX - run MatrixTranspose.exe [NOTES] - The path to the MS cl compiler is needed cause nvcc uses it for host compilation - Setting the `--gpu-architecture` depends on NVIDIA GPU to run on - The execution results are correct according to the margin of error = 0.000001 2. [Linux] To be accomplished by PSDB
1 parent 7ea6313 commit 31d3146

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

amd/hipcc/bin/hipcc.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ sub get_normalized_path {
532532
$ENV{HCC_EXTRA_LIBRARIES}="\n";
533533
}
534534

535-
if ($hasCXX and $HIP_PLATFORM eq 'nvidia') {
535+
if ($HIP_PLATFORM eq 'nvidia') {
536536
$HIPCXXFLAGS .= " -x cu";
537537
}
538538

0 commit comments

Comments
 (0)