Skip to content

Hoist the eb_flow tracer device vector out of the MFIter loop. - #201

Open
WeiqunZhang wants to merge 1 commit into
AMReX-Fluids:developmentfrom
WeiqunZhang:fix-eb-tracer-devicevector-lifetime
Open

Hoist the eb_flow tracer device vector out of the MFIter loop.#201
WeiqunZhang wants to merge 1 commit into
AMReX-Fluids:developmentfrom
WeiqunZhang:fix-eb-tracer-devicevector-lifetime

Conversation

@WeiqunZhang

Copy link
Copy Markdown
Member

It was constructed per box and destroyed right after the async ParallelFor that captures its data() pointer, so a kernel could read freed device memory. At function scope it outlives the loop, whose MFIter destructor synchronizes every stream used. The values are box-independent, so this also drops a per-box host-to-device copy.

Fixes #170.

It was constructed per box and destroyed right after the async ParallelFor that captures its data() pointer, so a kernel could read freed device memory. At function scope it outlives the loop, whose MFIter destructor synchronizes every stream used. The values are box-independent, so this also drops a per-box host-to-device copy.

Fixes AMReX-Fluids#170.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set_eb_tracer: per-box Gpu::DeviceVector freed while async ParallelFor may still read it

1 participant