File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,28 @@ debug: all
143143profile : CUDA_FLAGS = $(CUDA_FLAGS ) -lineinfo
144144profile : HIP_FLAGS = $(HIP_FLAGS ) -g
145145profile : all
146+ @echo " Generating profile data..."
147+ @mkdir -p $(PROFILE_DIR )
148+ ifeq ($(BUILD_HIP ) ,1)
149+ @echo "Running HIP profiling..."
150+ @for target in $(HIP_TARGETS); do \
151+ if [ -f $$target ]; then \
152+ echo "Profiling $$target..."; \
153+ rocprof -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "rocprof completed"; \
154+ fi; \
155+ done
156+ endif
157+ ifeq ($(BUILD_CUDA ) ,1)
158+ @echo "Running CUDA profiling..."
159+ @for target in $(CUDA_TARGETS); do \
160+ if [ -f $$target ]; then \
161+ echo "Profiling $$target..."; \
162+ nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
163+ fi; \
164+ done
165+ endif
166+ @echo "Profile data saved to $(PROFILE_DIR)/"
167+ @ls -la $(PROFILE_DIR)/
146168
147169# Clean
148170.PHONY : clean
You can’t perform that action at this time.
0 commit comments