Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .github/workflows/build-rocm-examples-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ jobs:
name: ctest-logs-${{ inputs.distro }}-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }}
path: build/Testing/Temporary/

- name: Makefile test
if: ${{ !cancelled() }}
run: |
make test HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}" 2>&1 | tee makefile_test_output.log

- name: Upload Makefile test logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: makefile-test-logs-${{ inputs.distro }}-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }}
path: makefile_test_output.log

- name: Clean the workspace
if: always()
run: find "$GITHUB_WORKSPACE" -mindepth 1 -delete
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
CMakeUserPresets.json
.cline_storage
config.mk
.claude/
7 changes: 6 additions & 1 deletion Applications/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ EXAMPLES := \
histogram \
prefix_sum

SKIP_FROM_TEST :=

ifneq ($(wildcard /usr/include/GLFW/glfw3.h),)
EXAMPLES += sobel_filter
endif
Expand All @@ -45,4 +47,7 @@ clean: all
$(EXAMPLES):
$(MAKE) -C $@ $(TARGET)

.PHONY: all clean $(EXAMPLES)
test: TARGET=test
test: $(filter-out $(SKIP_FROM_TEST),$(EXAMPLES))

.PHONY: all clean test $(EXAMPLES)
5 changes: 4 additions & 1 deletion Applications/bitonic_sort/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion Applications/convolution/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
8 changes: 6 additions & 2 deletions Applications/fdtd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ COMMON_INCLUDE_DIR := ../../Common
EXTERNAL_DIR := ../../External
GPU_RUNTIME ?= HIP

include $(COMMON_INCLUDE_DIR)/find_filesystem.mk
# HIP variables
ROCM_PATH ?= /opt/rocm
HIP_INCLUDE_DIR := $(ROCM_PATH)/include
Expand All @@ -36,7 +37,7 @@ CXX_STD := c++17
ICXXFLAGS := -std=$(CXX_STD)
ICPPFLAGS := -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR)
ILDFLAGS :=
ILDLIBS := -lstdc++fs
ILDLIBS := $(CXX_FS_LIB)

ifeq ($(GPU_RUNTIME), CUDA)
ICXXFLAGS += -x cu
Expand All @@ -55,7 +56,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion Applications/floyd_warshall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion Applications/histogram/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion Applications/monte_carlo_pi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(COMMON_INCLUDE_DIR)/hiprand_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion Applications/prefix_sum/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
8 changes: 6 additions & 2 deletions Applications/sobel_filter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ $(EXAMPLE): $(SRCS) $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdP

$(EXTERNAL_DIR)/glad/glad.cpp: $(EXTERNAL_DIR)/glad/glad.h

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test

else
all:
clean:
.PHONY: all clean
test:
.PHONY: all clean test
endif
7 changes: 6 additions & 1 deletion HIP-Basic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ EXAMPLES := \
texture_management \
warp_shuffle

SKIP_FROM_TEST :=

ifneq ($(wildcard /usr/include/GLFW/glfw3.h),)
EXAMPLES += opengl_interop
ifneq ($(wildcard /usr/include/vulkan/vulkan.h),)
Expand All @@ -68,4 +70,7 @@ clean: all
$(EXAMPLES):
$(MAKE) -C $@ $(TARGET)

.PHONY: all clean $(EXAMPLES)
test: TARGET=test
test: $(filter-out $(SKIP_FROM_TEST),$(EXAMPLES))

.PHONY: all clean test $(EXAMPLES)
5 changes: 4 additions & 1 deletion HIP-Basic/assembly_to_executable/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ main_%.s: main.hip
main_%.o: main_%.s
$(CLANG) -target amdgcn-amd-amdhsa -mcpu=$* -o $@ $<

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
rm -f \
main_*.o \
Expand All @@ -90,4 +93,4 @@ clean:
main.o \
$(EXAMPLE)

.PHONY: clean $(EXAMPLE)
.PHONY: clean $(EXAMPLE) test
5 changes: 4 additions & 1 deletion HIP-Basic/bandwidth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp $(EXTERNAL_DIR)/CmdParser/cmdparser.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/bit_extract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/cooperative_groups/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/device_globals/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/device_query/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.cpp $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/dynamic_shared/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/events/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/gpu_arch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/hello_world/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/hipify/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ main.hip: main.cu
$(EXAMPLE): main.hip
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE) main.hip *.o

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/inline_assembly/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/llvm_ir_to_executable/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ main_%.ll: main_%.bc
main_%.bc: main.hip
$(HIPCXX) --cuda-device-only -c -emit-llvm --offload-arch=$* -o $@ -I ../../Common -std=c++17 $<

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
rm -f \
main_device*.o \
Expand All @@ -96,4 +99,4 @@ clean:
main_*.ll \
$(EXAMPLE)

.PHONY: clean $(EXAMPLE)
.PHONY: clean $(EXAMPLE) test
5 changes: 4 additions & 1 deletion HIP-Basic/matrix_multiplication/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
8 changes: 6 additions & 2 deletions HIP-Basic/module_api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ EXAMPLE := hip_module_api
COMMON_INCLUDE_DIR := ../../Common
GPU_RUNTIME ?= HIP

include $(COMMON_INCLUDE_DIR)/find_filesystem.mk
ifneq ($(GPU_RUNTIME), HIP)
$(error GPU_RUNTIME is set to "$(GPU_RUNTIME)". GPU_RUNTIME must be HIP.)
endif
Expand All @@ -40,7 +41,7 @@ CXXFLAGS ?= -Wall -Wextra
ICXXFLAGS := -std=$(CXX_STD)
ICPPFLAGS := -I $(COMMON_INCLUDE_DIR)
ILDFLAGS :=
ILDLIBS := -lstdc++fs
ILDLIBS := $(CXX_FS_LIB)

ICXXFLAGS += $(CXXFLAGS)
ICPPFLAGS += $(CPPFLAGS)
Expand All @@ -53,7 +54,10 @@ $(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp module.co
module.co: module.hip
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) --genco -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE) module.co

.PHONY: clean
.PHONY: clean test
5 changes: 4 additions & 1 deletion HIP-Basic/moving_average/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ILDLIBS += $(LDLIBS)
$(EXAMPLE): main.hip $(COMMON_INCLUDE_DIR)/example_utils.hpp
$(HIPCXX) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS)

test: $(EXAMPLE)
./$(EXAMPLE) $(TEST_ARGS)

clean:
$(RM) $(EXAMPLE)

.PHONY: clean
.PHONY: clean test
Loading
Loading