Skip to content

Commit

Permalink
Avoid force-loading all modules in tests with graph capture
Browse files Browse the repository at this point in the history
  • Loading branch information
nvlukasz committed Aug 13, 2024
1 parent 792a135 commit beea7d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion warp/tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def __init__(self, use_graph=True, stream=None):

def __enter__(self):
if self.use_graph:
wp.capture_begin(stream=self.stream)
# preload module before graph capture
wp.load_module(device=wp.get_device())
wp.capture_begin(stream=self.stream, force_module_load=False)

def __exit__(self, exc_type, exc_value, traceback):
if self.use_graph:
Expand Down
5 changes: 4 additions & 1 deletion warp/tests/test_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ def foo(a: wp.array(dtype=int)):
with wp.ScopedDevice(device):
a = wp.zeros(1, dtype=int)

# preload module before graph capture
wp.load_module(device=device)

# capture a launch
with wp.ScopedCapture() as capture:
with wp.ScopedCapture(force_module_load=False) as capture:
wp.launch(foo, dim=1, inputs=[a])

# unload the module
Expand Down

0 comments on commit beea7d8

Please sign in to comment.