Skip to content

Commit 5591092

Browse files
committed
Upgrade to use rocprofv3
1 parent 90cff67 commit 5591092

File tree

9 files changed

+142
-2
lines changed

9 files changed

+142
-2
lines changed

modules/module1/examples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ ifeq ($(BUILD_HIP),1)
197197
@for target in $(HIP_TARGETS); do \
198198
if [ -f $$target ]; then \
199199
echo "Profiling $$target..."; \
200-
rocprof -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "rocprof completed"; \
200+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
201201
fi; \
202202
done
203203
endif

modules/module2/examples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ ifeq ($(BUILD_HIP),1)
150150
@for target in $(HIP_TARGETS); do \
151151
if [ -f $$target ]; then \
152152
echo "Profiling $$target..."; \
153-
rocprof -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "rocprof completed"; \
153+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
154154
fi; \
155155
done
156156
endif

modules/module3/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,26 @@ debug: all
148148
profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
149149
profile: HIP_FLAGS = $(HIP_FLAGS) -g
150150
profile: all
151+
@echo "Generating profile data..."
152+
@mkdir -p $(PROFILE_DIR)
153+
ifeq ($(BUILD_HIP),1)
154+
@echo "Running HIP profiling..."
155+
@for target in $(HIP_TARGETS); do \
156+
if [ -f $$target ]; then \
157+
echo "Profiling $$target..."; \
158+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
159+
fi; \
160+
done
161+
endif
162+
ifeq ($(BUILD_CUDA),1)
163+
@echo "Running CUDA profiling..."
164+
@for target in $(CUDA_TARGETS); do \
165+
if [ -f $$target ]; then \
166+
echo "Profiling $$target..."; \
167+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
168+
fi; \
169+
done
170+
endif
151171

152172
# Clean\n.PHONY: clean\nclean:\n\t@echo \"Cleaning build artifacts...\"\n\trm -rf $(BUILD_DIR) $(PROFILE_DIR)
153173

modules/module4/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ debug: all
157157
profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
158158
profile: HIP_FLAGS = $(HIP_FLAGS) -g
159159
profile: all
160+
@echo "Generating profile data..."
161+
@mkdir -p $(PROFILE_DIR)
162+
ifeq ($(BUILD_HIP),1)
163+
@echo "Running HIP profiling..."
164+
@for target in $(HIP_TARGETS); do \
165+
if [ -f $$target ]; then \
166+
echo "Profiling $$target..."; \
167+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
168+
fi; \
169+
done
170+
endif
171+
ifeq ($(BUILD_CUDA),1)
172+
@echo "Running CUDA profiling..."
173+
@for target in $(CUDA_TARGETS); do \
174+
if [ -f $$target ]; then \
175+
echo "Profiling $$target..."; \
176+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
177+
fi; \
178+
done
179+
endif
160180

161181
# Clean
162182
.PHONY: clean

modules/module5/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,26 @@ debug: all
128128
profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
129129
profile: HIP_FLAGS = $(HIP_FLAGS) -g
130130
profile: all
131+
@echo "Generating profile data..."
132+
@mkdir -p $(PROFILE_DIR)
133+
ifeq ($(BUILD_HIP),1)
134+
@echo "Running HIP profiling..."
135+
@for target in $(HIP_TARGETS); do \
136+
if [ -f $$target ]; then \
137+
echo "Profiling $$target..."; \
138+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
139+
fi; \
140+
done
141+
endif
142+
ifeq ($(BUILD_CUDA),1)
143+
@echo "Running CUDA profiling..."
144+
@for target in $(CUDA_TARGETS); do \
145+
if [ -f $$target ]; then \
146+
echo "Profiling $$target..."; \
147+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
148+
fi; \
149+
done
150+
endif
131151

132152
# Clean build artifacts
133153
.PHONY: clean

modules/module6/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,26 @@ debug: all
126126
profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
127127
profile: HIP_FLAGS = $(HIP_FLAGS) -g
128128
profile: all
129+
@echo "Generating profile data..."
130+
@mkdir -p $(PROFILE_DIR)
131+
ifeq ($(BUILD_HIP),1)
132+
@echo "Running HIP profiling..."
133+
@for target in $(HIP_TARGETS); do \
134+
if [ -f $$target ]; then \
135+
echo "Profiling $$target..."; \
136+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
137+
fi; \
138+
done
139+
endif
140+
ifeq ($(BUILD_CUDA),1)
141+
@echo "Running CUDA profiling..."
142+
@for target in $(CUDA_TARGETS); do \
143+
if [ -f $$target ]; then \
144+
echo "Profiling $$target..."; \
145+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
146+
fi; \
147+
done
148+
endif
129149

130150
# Algorithm-specific targets
131151
.PHONY: convolution

modules/module7/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@ debug: all
134134
profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
135135
profile: HIP_FLAGS = $(HIP_FLAGS) -g
136136
profile: all
137+
@echo "Generating profile data..."
138+
@mkdir -p $(PROFILE_DIR)
139+
ifeq ($(BUILD_HIP),1)
140+
@echo "Running HIP profiling..."
141+
@for target in $(HIP_TARGETS); do \
142+
if [ -f $$target ]; then \
143+
echo "Profiling $$target..."; \
144+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
145+
fi; \
146+
done
147+
endif
148+
ifeq ($(BUILD_CUDA),1)
149+
@echo "Running CUDA profiling..."
150+
@for target in $(CUDA_TARGETS); do \
151+
if [ -f $$target ]; then \
152+
echo "Profiling $$target..."; \
153+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
154+
fi; \
155+
done
156+
endif
137157

138158
# Algorithm-specific targets
139159
.PHONY: sorting

modules/module8/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,26 @@ debug: all
191191
profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
192192
profile: HIP_FLAGS = $(HIP_FLAGS) -g
193193
profile: all
194+
@echo "Generating profile data..."
195+
@mkdir -p $(PROFILE_DIR)
196+
ifeq ($(BUILD_HIP),1)
197+
@echo "Running HIP profiling..."
198+
@for target in $(HIP_TARGETS); do \
199+
if [ -f $$target ]; then \
200+
echo "Profiling $$target..."; \
201+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
202+
fi; \
203+
done
204+
endif
205+
ifeq ($(BUILD_CUDA),1)
206+
@echo "Running CUDA profiling..."
207+
@for target in $(CUDA_TARGETS); do \
208+
if [ -f $$target ]; then \
209+
echo "Profiling $$target..."; \
210+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
211+
fi; \
212+
done
213+
endif
194214

195215
# Professional builds with maximum optimization
196216
.PHONY: production

modules/module9/examples/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,26 @@ profile: CUDA_FLAGS = $(CUDA_FLAGS) -lineinfo
206206
profile: HIP_FLAGS = $(HIP_FLAGS) -g
207207
profile: CXX_FLAGS += -g -pg
208208
profile: all
209+
@echo "Generating profile data..."
210+
@mkdir -p $(PROFILE_DIR)
211+
ifeq ($(BUILD_HIP),1)
212+
@echo "Running HIP profiling..."
213+
@for target in $(HIP_TARGETS); do \
214+
if [ -f $$target ]; then \
215+
echo "Profiling $$target..."; \
216+
rocprofv3 --runtime-trace --output-format csv -d $(PROFILE_DIR) -o $$(basename $$target).csv -- $$target 2>/dev/null || echo "rocprofv3 completed"; \
217+
fi; \
218+
done
219+
endif
220+
ifeq ($(BUILD_CUDA),1)
221+
@echo "Running CUDA profiling..."
222+
@for target in $(CUDA_TARGETS); do \
223+
if [ -f $$target ]; then \
224+
echo "Profiling $$target..."; \
225+
nvprof --csv -o $(PROFILE_DIR)/$$(basename $$target).csv $$target 2>/dev/null || echo "nvprof completed"; \
226+
fi; \
227+
done
228+
endif
209229

210230
# Production builds with security hardening
211231
.PHONY: production

0 commit comments

Comments
 (0)