Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions include/cucascade/data/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ class idata_representation {
*/
virtual std::size_t get_size_in_bytes() const = 0;

/**
* @brief Get the logical (uncompressed) data size in bytes
*
* For representations that store data in a compressed format (e.g. Parquet), this returns
* the uncompressed data size. For uncompressed representations, this returns the same value
* as get_size_in_bytes().
*
* @return std::size_t The logical data size in bytes
*/
virtual std::size_t get_logical_data_size_in_bytes() const = 0;

/**
* @brief Create a deep copy of this data representation.
*
Expand Down
10 changes: 10 additions & 0 deletions include/cucascade/data/cpu_data_representation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ class host_data_representation : public idata_representation {
*/
std::size_t get_size_in_bytes() const override;

/**
* @copydoc idata_representation::get_logical_data_size_in_bytes
*/
std::size_t get_logical_data_size_in_bytes() const override;

/**
* @brief Create a deep copy of this representation in the same memory space.
*
Expand Down Expand Up @@ -101,6 +106,11 @@ class host_data_packed_representation : public idata_representation {
*/
std::size_t get_size_in_bytes() const override;

/**
* @copydoc idata_representation::get_logical_data_size_in_bytes
*/
std::size_t get_logical_data_size_in_bytes() const override;

/**
* @brief Create a deep copy of this host table representation.
*
Expand Down
5 changes: 5 additions & 0 deletions include/cucascade/data/gpu_data_representation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ class gpu_table_representation : public idata_representation {
*/
std::size_t get_size_in_bytes() const override;

/**
* @copydoc idata_representation::get_logical_data_size_in_bytes
*/
std::size_t get_logical_data_size_in_bytes() const override;

/**
* @brief Create a deep copy of this GPU table representation.
*
Expand Down
10 changes: 10 additions & 0 deletions src/data/cpu_data_representation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ host_data_representation::host_data_representation(

std::size_t host_data_representation::get_size_in_bytes() const { return _host_table->data_size; }

std::size_t host_data_representation::get_logical_data_size_in_bytes() const
{
return get_size_in_bytes();
}

const std::unique_ptr<memory::host_table_allocation>& host_data_representation::get_host_table()
const
{
Expand Down Expand Up @@ -87,6 +92,11 @@ std::size_t host_data_packed_representation::get_size_in_bytes() const
return _host_table->data_size;
}

std::size_t host_data_packed_representation::get_logical_data_size_in_bytes() const
{
return get_size_in_bytes();
}

const std::unique_ptr<cucascade::memory::host_table_packed_allocation>&
host_data_packed_representation::get_host_table() const
{
Expand Down
5 changes: 5 additions & 0 deletions src/data/gpu_data_representation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ gpu_table_representation::gpu_table_representation(std::unique_ptr<cudf::table>

std::size_t gpu_table_representation::get_size_in_bytes() const { return _table->alloc_size(); }

std::size_t gpu_table_representation::get_logical_data_size_in_bytes() const
{
return get_size_in_bytes();
}

const cudf::table& gpu_table_representation::get_table() const { return *_table; }

std::unique_ptr<cudf::table> gpu_table_representation::release_table() { return std::move(_table); }
Expand Down
2 changes: 2 additions & 0 deletions test/utils/mock_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class mock_data_representation : private mock_memory_space_holder, public idata_

std::size_t get_size_in_bytes() const override { return _size; }

std::size_t get_logical_data_size_in_bytes() const override { return _size; }

std::unique_ptr<idata_representation> clone(
[[maybe_unused]] rmm::cuda_stream_view stream) override
{
Expand Down
Loading