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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user