Skip to content

Commit

Permalink
Fix GPU function reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryberger committed Aug 23, 2024
1 parent 7b3adc6 commit d6c0ebb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions scalene/scalene_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def output_profile_line(
n_cpu_percent_c = 0
n_cpu_percent_python = 0

# n_gpu_percent = n_gpu_samples * 100

if True:
if stats.n_gpu_samples[fname][line_no]:
n_gpu_percent = (
Expand Down Expand Up @@ -539,6 +537,7 @@ def output_profiles(
all_samples |= set(fn_stats.cpu_samples_c.keys())
all_samples |= set(fn_stats.memory_malloc_samples.keys())
all_samples |= set(fn_stats.memory_free_samples.keys())
all_samples |= set(fn_stats.gpu_samples.keys())
print_fn_summary = any(fn != fname for fn in all_samples)
output["files"][fname_print]["functions"] = []
if print_fn_summary:
Expand Down
5 changes: 0 additions & 5 deletions scalene/scalene_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,6 @@ def build_function_stats(self, filename: Filename) -> ScaleneStatistics:
first_line_no
] += self.memory_aggregate_footprint[filename][line_no]

for fn_name in fn_stats.gpu_samples:
n_gpu_samples = fn_stats.n_gpu_samples[fn_name][first_line_no]
if n_gpu_samples != 0:
fn_stats.gpu_samples[fn_name][first_line_no] /= n_gpu_samples

return fn_stats

payload_contents = [
Expand Down

0 comments on commit d6c0ebb

Please sign in to comment.