fix: use ROCm amdclang++ as HIP compiler, keep GCC for CPU code

Setting CXX=hipcc caused compilation failures on CPU backends (AVX
intrinsics). Now using GCC for CPU, ROCm's amdclang++ for HIP only.
This commit is contained in:
2026-05-09 22:29:10 -04:00
parent d8b77c97c3
commit 5b210fe624

View File

@@ -42,13 +42,14 @@ ENV PATH=/opt/rocm/bin:/opt/rocm/hip/bin:/opt/rocm/hcc/bin:/usr/local/sbin:/usr/
ENV CMAKE_GENERATOR=Ninja
ENV LDFLAGS=-s
# Build with ROCm 6 preset + gfx906 target (CXX=hipcc for legacy HIP mode)
# Build with ROCm 6 preset + gfx906 target (ROCm clang for HIP, GCC for CPU)
RUN mkdir -p build && cd build && \
CC=hipcc CXX=hipcc cmake .. \
cmake .. \
--preset 'ROCm 6' \
-DAMDGPU_TARGETS="gfx906:xnack-;gfx940;gfx1010;gfx1030;gfx1100;gfx1200" \
-DCMAKE_HIP_COMPILER=/opt/rocm/bin/amdclang++ \
-DCMAKE_BUILD_TYPE=Release && \
CC=hipcc CXX=hipcc cmake --build . -- -l $(nproc) && \
cmake --build . -- -l $(nproc) && \
cmake --install . --component HIP --strip --prefix /build/dist
# Build the Go binary