14 #include <cudf/packed_types.hpp>
15 #include <cudf/table/table.hpp>
16 #include <cudf/table/table_view.hpp>
19 #include <coro/task.hpp>
21 #include <rapidsmpf/memory/content_description.hpp>
22 #include <rapidsmpf/memory/packed_data.hpp>
23 #include <rapidsmpf/owning_wrapper.hpp>
24 #include <rapidsmpf/streaming/core/context.hpp>
25 #include <rapidsmpf/streaming/core/memory_reserve_or_wait.hpp>
26 #include <rapidsmpf/streaming/core/message.hpp>
296 [[nodiscard]] std::pair<cudf::size_type, cudf::size_type>
shape() const noexcept;
306 std::unique_ptr<cudf::table> table_;
307 std::unique_ptr<PackedData> packed_data_;
310 std::optional<cudf::table_view> table_view_;
313 std::array<std::size_t,
MEMORY_TYPES.size()> data_alloc_size_ = {};
314 std::size_t make_available_cost_;
Class managing buffer resources.
Description of an object's content.
Represents a reservation for future memory allocation.
Utility class to store an arbitrary type-erased object while another object is alive.
Context for actors (coroutines) in rapidsmpf.
Asynchronous coordinator for memory reservation requests.
Type-erased message wrapper around a payload.
A unit of table data in a streaming pipeline.
std::size_t make_available_cost() const noexcept
Returns the estimated cost (in bytes) of making the table available.
TableChunk make_available(MemoryReservation &reservation)
Moves this table chunk into a new one with its cudf table made available.
TableChunk copy(MemoryReservation &reservation) const
Create a deep copy of the table chunk.
TableChunk(cudf::table_view table_view, rmm::cuda_stream_view stream, OwningWrapper &&owner, ExclusiveView exclusive_view)
Construct a TableChunk from a device table view.
ExclusiveView
Indicates whether the TableChunk holds an exclusive or shared view of the underlying table data.
bool is_available() const noexcept
Indicates whether the underlying cudf table data is fully available in device memory.
TableChunk(std::unique_ptr< cudf::table > table, rmm::cuda_stream_view stream)
Construct a TableChunk from a device table.
std::size_t data_alloc_size(MemoryType mem_type) const
Number of bytes allocated for the data in the specified memory type.
std::pair< cudf::size_type, cudf::size_type > shape() const noexcept
Return the shape of the table stored by the table chunk.
TableChunk & operator=(TableChunk &&other) noexcept
Move assignment.
rmm::cuda_stream_view stream() const noexcept
Returns the CUDA stream on which this table chunk was created.
cudf::table_view table_view() const
Returns a view of the underlying table.
TableChunk(TableChunk &&other) noexcept
Move constructor.
std::unique_ptr< PackedData > into_packed_data(BufferResource *br) &&
Convert this table chunk to a PackedData, avoiding unnecessary copies.
TableChunk(std::unique_ptr< PackedData > packed_data)
Construct a TableChunk from a packed data blob.
bool is_spillable() const
Indicates whether this table chunk can be spilled to device memory.
ContentDescription get_content_description(PackedData const &obj)
Generate a content description for PackedData.
Message to_message(std::uint64_t sequence_number, std::unique_ptr< PackedData > chunk)
Wrap PackedData into a Message.
@ YES
Overbooking is allowed.
@ NO
Overbooking is not allowed.
constexpr std::array< MemoryType, 3 > MEMORY_TYPES
All memory types sorted in decreasing order of preference.
MemoryType
Enum representing the type of memory sorted in decreasing order of preference.
Bag of bytes with metadata suitable for sending over the wire.