Skip to content

Commit

Permalink
Merge branch 'lwawrzyniak/fix-force-load-error-in-test-reload' into '…
Browse files Browse the repository at this point in the history
…main'

Avoid force-loading all modules in tests with graph capture

See merge request omniverse/warp!677
  • Loading branch information
nvlukasz committed Aug 13, 2024
2 parents 792a135 + beea7d8 commit 07d5312
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 07d5312

Please sign in to comment.