Skip to content

Commit

Permalink
Add copy and move restrictions to the event wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcrimsontianyu committed Sep 18, 2024
1 parent f323335 commit 5c28023
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cpp/src/utilities/stream_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ struct cuda_event {
cuda_event() { CUDF_CUDA_TRY(cudaEventCreateWithFlags(&e_, cudaEventDisableTiming)); }
virtual ~cuda_event() { CUDF_ASSERT_CUDA_SUCCESS(cudaEventDestroy(e_)); }

// Moveable but not copyable.
cuda_event(const cuda_event&) = delete;
cuda_event& operator=(const cuda_event&) = delete;

cuda_event(cuda_event&&) = default;
cuda_event& operator=(cuda_event&&) = default;

operator cudaEvent_t() { return e_; }

private:
Expand Down

0 comments on commit 5c28023

Please sign in to comment.