Skip to content

Commit

Permalink
Add MemoryType::RESULT_TILE
Browse files Browse the repository at this point in the history
Rename TILE_BITMAP -> RESULT_TILE_BITMAP
  • Loading branch information
shaunrd0 committed Mar 13, 2024
1 parent d1189ef commit ea387b3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions test/src/unit-result-tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ TEST_CASE_METHOD(
std::iota(range_indexes.begin(), range_indexes.end(), 0);

auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_count(num_cells, 1, resource);
ResultTile::compute_results_count_sparse_string(
&rt,
Expand Down Expand Up @@ -426,7 +426,7 @@ TEST_CASE_METHOD(
std::iota(range_indexes.begin(), range_indexes.end(), 0);

auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint64_t> result_count(num_cells, 1, resource);
ResultTile::compute_results_count_sparse_string(
&rt,
Expand Down
6 changes: 4 additions & 2 deletions tiledb/common/memory_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ std::string memory_type_to_str(MemoryType type) {
return "GenericTileIO";
case MemoryType::RTREE:
return "RTree";
case MemoryType::TILE_BITMAP:
return "TileBitmap";
case MemoryType::TILE_DATA:
return "TileData";
case MemoryType::TILE_HILBERT_VALUES:
Expand Down Expand Up @@ -96,6 +94,10 @@ std::string memory_type_to_str(MemoryType type) {
return "Metadata";
case MemoryType::WRITER_DATA:
return "WriterData";
case MemoryType::RESULT_TILE_BITMAP:
return "ResultTileBitmap";
case MemoryType::RESULT_TILE:
return "ResultTile";
}

auto val = std::to_string(static_cast<uint32_t>(type));
Expand Down
3 changes: 2 additions & 1 deletion tiledb/common/memory_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ enum class MemoryType {
FILTERED_DATA_BLOCK,
GENERIC_TILE_IO,
RTREE,
TILE_BITMAP,
TILE_DATA,
TILE_HILBERT_VALUES,
TILE_OFFSETS,
Expand All @@ -124,6 +123,8 @@ enum class MemoryType {
TILE_SUMS,
WRITER_TILE_DATA,
WRITER_DATA,
RESULT_TILE,
RESULT_TILE_BITMAP
};

/**
Expand Down
2 changes: 1 addition & 1 deletion tiledb/common/test/unit_memory_tracker_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
using namespace tiledb::common;

TEST_CASE("memory_type_to_str") {
auto max = static_cast<int>(tiledb::sm::MemoryType::TILE_WRITER_DATA);
auto max = static_cast<int>(tiledb::sm::MemoryType::RESULT_TILE_BITMAP);
size_t failures = 0;
for (int8_t i = 0; i < 127; i++) {
auto val = static_cast<tiledb::sm::MemoryType>(i);
Expand Down
4 changes: 2 additions & 2 deletions tiledb/sm/query/legacy/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ Status Reader::compute_range_result_coords(
}
} else { // Sparse
auto resource =
query_memory_tracker_->get_resource(MemoryType::TILE_BITMAP);
query_memory_tracker_->get_resource(MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_bitmap(coords_num, 1, resource);

// Compute result and overwritten bitmap per dimension
Expand Down Expand Up @@ -1788,7 +1788,7 @@ Status Reader::get_all_result_coords(
if (fragment_metadata_[tile->frag_idx()]->has_timestamps() &&
partial_overlap) {
auto resource =
query_memory_tracker_->get_resource(MemoryType::TILE_BITMAP);
query_memory_tracker_->get_resource(MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_bitmap(coords_num, 1, resource);
RETURN_NOT_OK(partial_overlap_condition_.apply_sparse<uint8_t>(
*(frag_meta->array_schema().get()), *tile, result_bitmap));
Expand Down
2 changes: 1 addition & 1 deletion tiledb/sm/query/readers/reader_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1375,5 +1375,5 @@ template <>
IndexedList<tiledb::sm::ResultTile>::IndexedList(
shared_ptr<tiledb::sm::MemoryTracker> memory_tracker)
: memory_tracker_(memory_tracker)
, list_(memory_tracker->get_resource(sm::MemoryType::TILE_DATA)) {
, list_(memory_tracker->get_resource(sm::MemoryType::RESULT_TILE)) {
}
6 changes: 3 additions & 3 deletions tiledb/sm/query/readers/result_tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ class ResultTileWithBitmap : public ResultTile {
*/
ResultTileWithBitmap(shared_ptr<MemoryTracker> memory_tracker)
: ResultTile(memory_tracker)
, bitmap_(memory_tracker_->get_resource(MemoryType::TILE_BITMAP)) {
, bitmap_(memory_tracker_->get_resource(MemoryType::RESULT_TILE_BITMAP)) {
}

ResultTileWithBitmap(
Expand All @@ -837,7 +837,7 @@ class ResultTileWithBitmap : public ResultTile {
const FragmentMetadata& frag_md,
shared_ptr<MemoryTracker> memory_tracker)
: ResultTile(frag_idx, tile_idx, frag_md, memory_tracker)
, bitmap_(memory_tracker_->get_resource(MemoryType::TILE_BITMAP))
, bitmap_(memory_tracker_->get_resource(MemoryType::RESULT_TILE_BITMAP))
, result_num_(cell_num_) {
}

Expand Down Expand Up @@ -989,7 +989,7 @@ class GlobalOrderResultTile : public ResultTileWithBitmap<BitmapType> {
, used_(false) {
if (!dups || include_delete_meta) {
post_dedup_bitmap_.emplace(
this->memory_tracker_->get_resource(MemoryType::TILE_BITMAP));
this->memory_tracker_->get_resource(MemoryType::RESULT_TILE_BITMAP));
}
}

Expand Down
10 changes: 5 additions & 5 deletions tiledb/sm/query/test/unit_query_condition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ void test_apply_cells_sparse<char*>(

// Apply the query condition.
auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_bitmap(cells, 1, resource);
REQUIRE(query_condition
.apply_sparse<uint8_t>(*array_schema, *result_tile, result_bitmap)
Expand All @@ -2752,7 +2752,7 @@ void test_apply_cells_sparse<char*>(

// Apply the query condition.
auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_bitmap_eq_null(cells, 1, resource);
REQUIRE(query_condition_eq_null
.apply_sparse<uint8_t>(
Expand Down Expand Up @@ -2824,7 +2824,7 @@ void test_apply_cells_sparse(

// Apply the query condition.
auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_bitmap(cells, 1, resource);
REQUIRE(query_condition
.apply_sparse<uint8_t>(*array_schema, *result_tile, result_bitmap)
Expand Down Expand Up @@ -3298,7 +3298,7 @@ void validate_qc_apply_sparse(
ResultTile& result_tile,
bool negated = false) {
auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> sparse_result_bitmap(cells, 1, resource);
REQUIRE(tp.qc_
.apply_sparse<uint8_t>(
Expand Down Expand Up @@ -5082,7 +5082,7 @@ TEST_CASE(

// Apply the query condition.
auto resource = tiledb::test::get_test_memory_tracker()->get_resource(
MemoryType::TILE_BITMAP);
MemoryType::RESULT_TILE_BITMAP);
tdb::pmr::vector<uint8_t> result_bitmap(cells, 1, resource);
REQUIRE(query_condition
.apply_sparse<uint8_t>(*array_schema, result_tile, result_bitmap)
Expand Down

0 comments on commit ea387b3

Please sign in to comment.