Skip to content

Commit

Permalink
Remove warnings from benchmarks.
Browse files Browse the repository at this point in the history
---
TYPE: IMPROVEMENT
DESC: Remove warnings from benchmarks.
  • Loading branch information
KiterLuc committed Oct 4, 2023
1 parent 553979c commit d6597a3
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 38 deletions.
16 changes: 10 additions & 6 deletions test/benchmarking/src/bench_large_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class Benchmark : public BenchmarkBase {
const unsigned skip = 2;
for (uint32_t i = 1; i < sparse_max_row; i += skip) {
for (uint32_t j = 1; j < sparse_max_col; j += skip) {
sparse_coords_.push_back(i);
sparse_coords_.push_back(j);
d1_.push_back(i);
d2_.push_back(j);
}
}
}
Expand Down Expand Up @@ -135,7 +135,8 @@ class Benchmark : public BenchmarkBase {
.set_data_buffer("b", data_b_)
.set_data_buffer("c", data_c_)
.set_offsets_buffer("c", off_c_)
.set_coordinates(sparse_coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
s_write_query.submit();
s_write_array.close();

Expand Down Expand Up @@ -168,14 +169,16 @@ class Benchmark : public BenchmarkBase {

Query query(ctx_, array);
data_a_.resize(query.est_result_size("a"));
sparse_coords_.resize(query.est_result_size("TILEDB_COORDS"));
d1_.resize(query.est_result_size("d1"));
d2_.resize(query.est_result_size("d2"));
query.set_subarray(Subarray(ctx_, array).set_subarray(subarray))
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_a_)
.set_data_buffer("b", data_b_)
.set_data_buffer("c", data_c_)
.set_offsets_buffer("c", off_c_)
.set_coordinates(sparse_coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -195,7 +198,8 @@ class Benchmark : public BenchmarkBase {
std::vector<uint64_t> off_c_;
std::vector<int> data_c_;

std::vector<uint32_t> sparse_coords_;
std::vector<uint32_t> d1_;
std::vector<uint32_t> d2_;
};

int main(int argc, char** argv) {
Expand Down
17 changes: 10 additions & 7 deletions test/benchmarking/src/bench_sparse_read_large_tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@ class Benchmark : public BenchmarkBase {
const unsigned skip = 2;
for (uint32_t i = 1; i < max_row; i += skip) {
for (uint32_t j = 1; j < max_col; j += skip) {
coords_.push_back(i);
coords_.push_back(j);
d1_.push_back(i);
d2_.push_back(j);
}
}

data_.resize(coords_.size() / 2);
data_.resize(d1_.size());
for (uint64_t i = 0; i < data_.size(); i++)
data_[i] = i;

Array array(ctx_, array_uri_, TILEDB_WRITE);
Query query(ctx_, array);
query.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -103,11 +104,13 @@ class Benchmark : public BenchmarkBase {
Array array(ctx_, array_uri_, TILEDB_READ);
Query query(ctx_, array);
data_.resize(query.est_result_size("a"));
coords_.resize(query.est_result_size("TILEDB_COORDS"));
d1_.resize(query.est_result_size("d1"));
d2_.resize(query.est_result_size("d2"));
query.set_subarray(Subarray(ctx_, array).set_subarray(subarray_))
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -120,7 +123,7 @@ class Benchmark : public BenchmarkBase {

Context ctx_;
std::vector<int> data_;
std::vector<uint32_t> subarray_, coords_;
std::vector<uint32_t> subarray_, d1_, d2_;
};

int main(int argc, char** argv) {
Expand Down
17 changes: 10 additions & 7 deletions test/benchmarking/src/bench_sparse_read_small_tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@ class Benchmark : public BenchmarkBase {
const unsigned skip = 2;
for (uint32_t i = 1; i < max_row; i += skip) {
for (uint32_t j = 1; j < max_col; j += skip) {
coords_.push_back(i);
coords_.push_back(j);
d1_.push_back(i);
d2_.push_back(j);
}
}

data_.resize(coords_.size() / 2);
data_.resize(d1_.size());
for (uint64_t i = 0; i < data_.size(); i++)
data_[i] = i;

Array array(ctx_, array_uri_, TILEDB_WRITE);
Query query(ctx_, array);
query.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -103,11 +104,13 @@ class Benchmark : public BenchmarkBase {
Array array(ctx_, array_uri_, TILEDB_READ);
Query query(ctx_, array);
data_.resize(query.est_result_size("a"));
coords_.resize(query.est_result_size("TILEDB_COORDS"));
d1_.resize(query.est_result_size("d1"));
d2_.resize(query.est_result_size("d2"));
query.set_subarray(Subarray(ctx_, array).set_subarray(subarray_))
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -120,7 +123,7 @@ class Benchmark : public BenchmarkBase {

Context ctx_;
std::vector<int> data_;
std::vector<uint32_t> subarray_, coords_;
std::vector<uint32_t> subarray_, d1_, d2_;
};

int main(int argc, char** argv) {
Expand Down
20 changes: 12 additions & 8 deletions test/benchmarking/src/bench_sparse_tile_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ class Benchmark : public BenchmarkBase {
const unsigned skip = 2;
for (uint32_t i = 1; i < max_row; i += skip) {
for (uint32_t j = 1; j < max_col; j += skip) {
coords_.push_back(i);
coords_.push_back(j);
d1_.push_back(i);
d2_.push_back(j);
}
}

data_.resize(coords_.size() / 2);
data_.resize(d1_.size());
for (uint64_t i = 0; i < data_.size(); i++)
data_[i] = i;

Expand All @@ -88,7 +88,8 @@ class Benchmark : public BenchmarkBase {
Query write_query(*ctx_, write_array);
write_query.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
write_query.submit();
write_array.close();
}
Expand All @@ -112,11 +113,13 @@ class Benchmark : public BenchmarkBase {
Array read_array(*ctx_, array_uri_, TILEDB_READ);
Query read_query(*ctx_, read_array);
data_.resize(read_query.est_result_size("a"));
coords_.resize(read_query.est_result_size("TILEDB_COORDS"));
d1_.resize(read_query.est_result_size("d1"));
d2_.resize(read_query.est_result_size("d2"));
read_query.set_subarray(Subarray(*ctx_, read_array).set_subarray(subarray_))
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
read_query.submit();
read_array.close();
}
Expand All @@ -130,7 +133,8 @@ class Benchmark : public BenchmarkBase {
query.set_subarray(Subarray(*ctx_, array).set_subarray(subarray_))
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -143,7 +147,7 @@ class Benchmark : public BenchmarkBase {

std::unique_ptr<Context> ctx_;
std::vector<int> data_;
std::vector<uint32_t> subarray_, coords_;
std::vector<uint32_t> subarray_, d1_, d2_;
};

int main(int argc, char** argv) {
Expand Down
11 changes: 6 additions & 5 deletions test/benchmarking/src/bench_sparse_write_large_tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ class Benchmark : public BenchmarkBase {
const unsigned skip = 2;
for (uint32_t i = 1; i < max_row; i += skip) {
for (uint32_t j = 1; j < max_col; j += skip) {
coords_.push_back(i);
coords_.push_back(j);
d1_.push_back(i);
d2_.push_back(j);
}
}

data_.resize(coords_.size() / 2);
data_.resize(d1_.size());
for (uint64_t i = 0; i < data_.size(); i++)
data_[i] = i;
}
Expand All @@ -88,7 +88,8 @@ class Benchmark : public BenchmarkBase {
Query query(ctx_, array);
query.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -101,7 +102,7 @@ class Benchmark : public BenchmarkBase {

Context ctx_;
std::vector<int> data_;
std::vector<uint32_t> coords_;
std::vector<uint32_t> d1_, d2_;
};

int main(int argc, char** argv) {
Expand Down
11 changes: 6 additions & 5 deletions test/benchmarking/src/bench_sparse_write_small_tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ class Benchmark : public BenchmarkBase {
const unsigned skip = 2;
for (uint32_t i = 1; i < max_row; i += skip) {
for (uint32_t j = 1; j < max_col; j += skip) {
coords_.push_back(i);
coords_.push_back(j);
d1_.push_back(i);
d2_.push_back(j);
}
}

data_.resize(coords_.size() / 2);
data_.resize(d1_.size());
for (uint64_t i = 0; i < data_.size(); i++)
data_[i] = i;
}
Expand All @@ -88,7 +88,8 @@ class Benchmark : public BenchmarkBase {
Query query(ctx_, array);
query.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_)
.set_coordinates(coords_);
.set_data_buffer("d1", d1_)
.set_data_buffer("d2", d2_);
query.submit();
array.close();
}
Expand All @@ -101,7 +102,7 @@ class Benchmark : public BenchmarkBase {

Context ctx_;
std::vector<int> data_;
std::vector<uint32_t> coords_;
std::vector<uint32_t> d1_, d2_;
};

int main(int argc, char** argv) {
Expand Down

0 comments on commit d6597a3

Please sign in to comment.