Skip to content

Commit 6944451

Browse files
committed
Get rid of global_debug and global_verbose -- move those some day to logger
1 parent df63201 commit 6944451

File tree

13 files changed

+13
-54
lines changed

13 files changed

+13
-54
lines changed

apis/python/src/tiledb/vector_search/module.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
namespace py = pybind11;
1212
using Ctx = tiledb::Context;
1313

14-
bool global_debug = false;
15-
1614
bool enable_stats = false;
1715
std::vector<json> core_stats;
1816

@@ -535,9 +533,11 @@ PYBIND11_MODULE(_tiledbvspy, m) {
535533
return json{core_stats}.dump();
536534
});
537535

536+
#if 0
538537
m.def("set_debug", [](bool debug) {
539538
global_debug = debug;
540539
});
540+
#endif
541541

542542
declare_vq_query_heap<uint8_t>(m, "u8");
543543
declare_vq_query_heap<float>(m, "f32");

src/include/detail/linalg/linalg_defs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,4 @@ using namespace Kokkos;
4040
using namespace Kokkos::Experimental;
4141
} // namespace stdx
4242

43-
extern bool global_verbose;
44-
extern bool global_debug;
45-
extern std::string global_region;
46-
4743
#endif // TDB_LINALG_DEFS_H

src/include/detail/linalg/matrix.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ std::string matrix_info(const std::span<T>& A, const std::string& msg = "") {
293293
return str;
294294
}
295295

296+
static bool matrix_printf = false;
297+
296298
template <class Matrix>
297299
void debug_matrix(const Matrix& A, const std::string& msg = "") {
298-
if (global_debug) {
300+
if (matrix_printf) {
299301
std::cout << matrix_info(A, msg) << std::endl;
300302
}
301303
}
@@ -306,7 +308,7 @@ void debug_slice(
306308
const std::string& msg = "",
307309
size_t rows = 5,
308310
size_t cols = 15) {
309-
if (global_debug) {
311+
if (matrix_printf) {
310312
rows = std::min(rows, A.num_rows());
311313
cols = std::min(cols, A.num_cols());
312314

@@ -328,7 +330,7 @@ void debug_slices_diff(
328330
const std::string& msg = "",
329331
size_t rows = 5,
330332
size_t cols = 15) {
331-
if (global_debug) {
333+
if (matrix_printf) {
332334
rows = std::min(rows, A.num_rows());
333335
cols = std::min(cols, A.num_cols());
334336

src/include/detail/linalg/tdb_io.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ void create_matrix(
4545
const tiledb::Context& ctx,
4646
const Matrix<T, LayoutPolicy, I>& A,
4747
const std::string& uri) {
48-
if (global_debug) {
49-
std::cerr << "# Creating Matrix: " << uri << std::endl;
50-
}
5148

5249
// @todo: make this a parameter
5350
size_t num_parts = 10;
@@ -86,9 +83,6 @@ void write_matrix(
8683
size_t start_pos = 0,
8784
bool create = true) {
8885
scoped_timer _{tdb_func__ + " " + std::string{uri}};
89-
if (global_debug) {
90-
std::cerr << "# Writing Matrix: " << uri << std::endl;
91-
}
9286

9387
if (create) {
9488
create_matrix<T, LayoutPolicy, I>(ctx, A, uri);
@@ -124,9 +118,6 @@ void write_matrix(
124118
template <class T>
125119
void create_vector(
126120
const tiledb::Context& ctx, std::vector<T>& v, const std::string& uri) {
127-
if (global_debug) {
128-
std::cerr << "# Creating std::vector: " << uri << std::endl;
129-
}
130121

131122
size_t num_parts = 10;
132123
size_t tile_extent = (size(v) + num_parts - 1) / num_parts;
@@ -156,10 +147,6 @@ void write_vector(
156147
bool create = true) {
157148
scoped_timer _{tdb_func__ + " " + std::string{uri}};
158149

159-
if (global_debug) {
160-
std::cerr << "# Writing std::vector: " << uri << std::endl;
161-
}
162-
163150
if (create) {
164151
create_vector<T>(ctx, v, uri);
165152
}
@@ -197,10 +184,6 @@ std::vector<T> read_vector(
197184
size_t end_pos = 0) {
198185
scoped_timer _{tdb_func__ + " " + std::string{uri}};
199186

200-
if (global_debug) {
201-
std::cerr << "# Reading std::vector: " << uri << std::endl;
202-
}
203-
204187
tiledb::Array array_ =
205188
tiledb_helpers::open_array(tdb_func__, ctx, uri, TILEDB_READ);
206189
auto schema_ = array_.schema();

src/include/detail/linalg/tdb_partitioned_matrix.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ using namespace Kokkos;
6262
using namespace Kokkos::Experimental;
6363
} // namespace stdx
6464

65-
extern bool global_verbose;
66-
extern bool global_debug;
67-
extern std::string global_region;
68-
6965
/**
7066
*
7167
* @note The template parameters indices_type and parts_type are deduced using

src/include/test/unit_ivf_index.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#include "../ivf_index.h"
3939
#include "../linalg.h"
4040

41-
bool global_debug = false;
42-
4341
TEST_CASE("ivf_index: test test", "[ivf_index]") {
4442
REQUIRE(true);
4543
}

src/include/test/unit_ivf_qv.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
#include "detail/linalg/tdb_io.h"
3737
#include "query_common.h"
3838

39-
bool global_verbose = false;
40-
bool global_debug = true;
41-
4239
TEST_CASE("qv: test test", "[qv]") {
4340
REQUIRE(true);
4441
}

src/include/test/unit_ivf_vq.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
#include "query_common.h"
3838
#include "utils/utils.h"
3939

40-
bool global_verbose = false;
41-
bool global_debug = false;
42-
4340
TEST_CASE("vq: test test", "[ivf vq]") {
4441
REQUIRE(true);
4542
}

src/include/test/unit_linalg.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include "linalg.h"
3838
#include "utils/utils.h"
3939

40-
bool global_debug = false;
41-
4240
using TestTypes =
4341
std::tuple<float, uint8_t, double, int, char, size_t, uint32_t>;
4442

src/include/test/unit_matrix.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include <vector>
3535
#include "detail/linalg/matrix.h"
3636

37-
bool global_debug = false;
38-
3937
using TestTypes = std::tuple<float, double, int, char, size_t, uint32_t>;
4038

4139
TEST_CASE("matrix: test test", "[matrix]") {

0 commit comments

Comments
 (0)