vecmem 1.24.0
Loading...
Searching...
No Matches
event_pool.hpp
1/*
2 * VecMem project, part of the ACTS project (R&D line)
3 *
4 * (c) 2026 CERN for the benefit of the ACTS project
5 *
6 * Mozilla Public License Version 2.0
7 */
8
9#pragma once
10
11// HIP include(s).
12#include <hip/hip_runtime_api.h>
13
14// System include(s).
15#include <vector>
16
17namespace vecmem {
18namespace hip {
19namespace details {
20
31
32public:
34 explicit event_pool(std::size_t size = 8u);
37
41 void free(hipEvent_t event);
42
43private:
45 std::vector<hipEvent_t> m_pool;
47 std::size_t m_used_events;
48
49}; // class event_pool
50
51} // namespace details
52} // namespace hip
53} // namespace vecmem
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Pool of hipEvent_t objects to use in the library.
Definition event_pool.hpp:30
void free(hipEvent_t event)
Return an event to the pool.
Definition event_pool.cpp:72
hipEvent_t create()
Get an event from the pool, creating a new one if necessary.
Definition event_pool.cpp:56
~event_pool()
Destructor.
Definition event_pool.cpp:48
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16