From 1a1731b8f3f3957dfe8de4c6289652034f47a7e4 Mon Sep 17 00:00:00 2001 From: Tianyu Liu Date: Wed, 18 Sep 2024 11:27:17 -0400 Subject: [PATCH] Add copy and move restrictions to the event wrapper --- cpp/src/utilities/stream_pool.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/src/utilities/stream_pool.cpp b/cpp/src/utilities/stream_pool.cpp index 039956660a0..9824c472b20 100644 --- a/cpp/src/utilities/stream_pool.cpp +++ b/cpp/src/utilities/stream_pool.cpp @@ -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: