Skip to content

Commit

Permalink
amdgpu-offload-arch by default only returns first device, use -a to g…
Browse files Browse the repository at this point in the history
…et all devices
  • Loading branch information
anthonix committed Jul 10, 2024
1 parent d680fbc commit c9949e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ endif

# AMD flags
ROCM_PATH ?= /opt/rocm
AMDGPU_TARGETS ?= $(shell $(ROCM_PATH)/llvm/bin/amdgpu-offload-arch)
AMDGPU_TARGETS ?= $(shell $(ROCM_PATH)/llvm/bin/amdgpu-offload-arch -a)
HIPCC := $(shell which hipcc 2>/dev/null)
HIPIFY := $(shell which hipify-perl 2>/dev/null)
HIPCC_FLAGS = -O3 -march=native -I$(BUILD_DIR)/hip -fno-strict-aliasing
Expand All @@ -76,7 +76,7 @@ else ifneq ($(filter gfx90a,$(AMDGPU_TARGETS)),)
else
$(error Did not find a supported AMD device. Rebuild with AMDGPU_TARGETS env variable to force build for device)
endif
ifeq ($(shell test `$(ROCM_PATH)/llvm/bin/amdgpu-arch | grep $(AMDGPU_TARGETS) | wc -l` -lt 2; echo $$?),0)
ifeq ($(shell test `$(ROCM_PATH)/llvm/bin/amdgpu-offload-arch -a | grep $(AMDGPU_TARGETS) | wc -l` -lt 2; echo $$?),0)
NO_MULTI_GPU ?= 1
endif
HIPCC_FLAGS += $(addprefix --offload-arch=,$(AMDGPU_TARGETS))
Expand Down

0 comments on commit c9949e9

Please sign in to comment.