Skip to content

Commit

Permalink
Fix uploading the EventSetup conditions from multiple CUDA streams
Browse files Browse the repository at this point in the history
When multiple CUDA streams are trying to initialise the same EventSetup object, the first one to do
so starts the asynchronous operations, and the others are supposed to wait for it to finish.
However, code for recording the CUDA event was missing, so the other streams would find the default-
constructed event, which is always "valid".

Adding the missing call to record the event fixes the problem.
  • Loading branch information
fwyzard committed Aug 2, 2021
1 parent 0884d51 commit 03b30c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HeterogeneousCore/CUDACore/interface/ESProduct.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ namespace cms {
transferAsync(data.m_data, cudaStream);
assert(data.m_fillingStream == nullptr);
data.m_fillingStream = cudaStream;
// Record in the cudaStream an event to mark the readiness of the
// EventSetup data on the GPU, so other streams can check for it
cudaCheck(cudaEventRecord(data.m_event.get(), cudaStream));
// Now the filling has been enqueued to the cudaStream, so we
// can return the GPU data immediately, since all subsequent
// work must be either enqueued to the cudaStream, or the cudaStream
Expand Down

0 comments on commit 03b30c3

Please sign in to comment.