Skip to content

Commit 666a9a0

Browse files
committed
Adding profile fix from previous PR
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent 61e286f commit 666a9a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

monai/utils/profiling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def torch_profiler_full(func):
5757

5858
@wraps(func)
5959
def wrapper(*args, **kwargs):
60-
with torch.autograd.profiler.profile() as prof:
60+
with torch.autograd.profiler.profile(use_device="cuda") as prof:
6161
result = func(*args, **kwargs)
6262

6363
print(prof, flush=True)
@@ -76,7 +76,7 @@ def torch_profiler_time_cpu_gpu(func):
7676

7777
@wraps(func)
7878
def wrapper(*args, **kwargs):
79-
with torch.autograd.profiler.profile() as prof:
79+
with torch.autograd.profiler.profile(use_device="cuda") as prof:
8080
result = func(*args, **kwargs)
8181

8282
cpu_time = prof.self_cpu_time_total

0 commit comments

Comments
 (0)