Skip to content

How does warp.ScopedCapture works? #565

Answered by shi-eric
DINHQuangDung1999 asked this question in Q&A
Discussion options

You must be logged in to vote

The TL;DR is that the ScopedCapture records (and does not execute) the CUDA operations (including the inputs and output pointers) like kernel launches, memory allocations, copies, event recording, etc.

The line self.sim_tick +=1 will be executed at the Python scope while the graph capture is being made, and subsequent launches of this graph will not run this line since the CUDA runtime never saw this operation. One workaround is to move these non-CUDA operations outside of the graph capture and manually increment them after the wp.capture_launch(self.graph).

Sometimes this isn't always sufficient as you might need access to the current value of self.sim_tick in one of your kernels. In thi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DINHQuangDung1999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants