CPPuddle
Loading...
Searching...
No Matches
hip_recycling_device_buffer.hpp
Go to the documentation of this file.
1// Copyright (c) 2020-2024 Gregor Daiß
2//
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#ifndef HIP_RECYCLING_BUFFER_HPP
7#define HIP_RECYCLING_BUFFER_HPP
8
9// import recycle_allocator_hip_device
11
15//
16namespace cppuddle {
17namespace memory_recycling {
18
21template <typename T, std::enable_if_t<std::is_trivial<T>::value, int> = 0>
43
46template <typename T, typename Host_Allocator, std::enable_if_t<std::is_trivial<T>::value, int> = 0>
50 hip_aggregated_device_buffer(size_t number_of_elements, Host_Allocator &alloc)
51 : number_of_elements(number_of_elements), alloc(alloc) {
53 alloc.allocate(number_of_elements);
54 }
58 // not yet implemented
63
64private:
65 Host_Allocator &alloc; // will stay valid for the entire aggregation region and hence
66 // for the entire lifetime of this buffer
67};
68
69} // namespace memory_recycling
70} // end namespace cppuddle
71#endif
Definition config.hpp:31
constexpr size_t max_number_gpus
Definition config.hpp:52
Definition buffer_management.hpp:770
Definition hip_recycling_device_buffer.hpp:47
hip_aggregated_device_buffer(hip_aggregated_device_buffer const &&other)=delete
size_t number_of_elements
Definition hip_recycling_device_buffer.hpp:49
hip_aggregated_device_buffer(size_t number_of_elements, Host_Allocator &alloc)
Definition hip_recycling_device_buffer.hpp:50
~hip_aggregated_device_buffer()
Definition hip_recycling_device_buffer.hpp:55
hip_aggregated_device_buffer(hip_aggregated_device_buffer const &other)=delete
hip_aggregated_device_buffer operator=(hip_aggregated_device_buffer const &&other)=delete
T * device_side_buffer
Definition hip_recycling_device_buffer.hpp:48
hip_aggregated_device_buffer operator=(hip_aggregated_device_buffer const &other)=delete
Definition hip_recycling_device_buffer.hpp:22
hip_device_buffer operator=(hip_device_buffer const &&other)=delete
recycle_allocator_hip_device< T > allocator
Definition hip_recycling_device_buffer.hpp:23
hip_device_buffer operator=(hip_device_buffer const &other)=delete
hip_device_buffer(hip_device_buffer const &other)=delete
hip_device_buffer(hip_device_buffer const &&other)=delete
size_t number_of_elements
Definition hip_recycling_device_buffer.hpp:25
T * device_side_buffer
Definition hip_recycling_device_buffer.hpp:24
~hip_device_buffer()
Definition hip_recycling_device_buffer.hpp:33
hip_device_buffer(size_t number_of_elements, size_t device_id)
Definition hip_recycling_device_buffer.hpp:27