Skip to content

Commit 6db9c6a

Browse files
Merge pull request #245 from CliMA/ck/annotate_and_range
Add nvtx range to callbacks
2 parents 3dfe810 + 1c844d0 commit 6db9c6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/integrators.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@ function __step!(integrator)
217217

218218
# apply callbacks
219219
discrete_callbacks = integrator.callback.discrete_callbacks
220-
for callback in discrete_callbacks
220+
for (ncb, callback) in enumerate(discrete_callbacks)
221221
if callback.condition(integrator.u, integrator.t, integrator)
222-
callback.affect!(integrator)
222+
NVTX.@range "Callback $ncb of $(length(discrete_callbacks))" color = colorant"yellow" begin
223+
callback.affect!(integrator)
224+
end
223225
end
224226
end
225227

0 commit comments

Comments
 (0)