Skip to content

[Bugfix]: Fix concurrency edge case in Gaussian - #183

Open
daniellegillai wants to merge 2 commits into
ROCm:developfrom
daniellegillai:sync-edge-gauss
Open

[Bugfix]: Fix concurrency edge case in Gaussian#183
daniellegillai wants to merge 2 commits into
ROCm:developfrom
daniellegillai:sync-edge-gauss

Conversation

@daniellegillai

Copy link
Copy Markdown
Contributor

Motivation

The current implementation of Gaussian has a concurrency edge case: if the operator is called on GPU, and then the same operator object is called on CPU, it is possible for the CPU-side call to start modifying the CPU memory held in m_hostKernelMem before the GPU-side call has finished copying it over, asynchronously, to GPU memory.

Also added a note to the header file clarifying the enforced serialization of this operator.

Technical Details

Call hipEventSynchronize(m_completionEvent) on both backends (rather than just GPU), so that a CPU call waits for any previous GPU-side operator call to complete its asynchronous GPU work (including the mem copy) before touching the CPU memory.

Test Plan

rocCV CTests tests.

Test Result

All CTests pass.

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.

1 participant