Skip to content

Commit

Permalink
And even more printouts
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorWalter committed Feb 27, 2024
1 parent e01d46a commit 8a30576
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/detect/uv_led_detect_fast_gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void uvdar::UVDARLedDetectFASTGPU::init() {
char err_str[4096];
int err_str_len = 0;

std::cerr << "[UVDARDetectorFASTGPU]: Initializing compute lib instance..." << std::endl;
// init compute lib instance
compute_inst = COMPUTE_LIB_INSTANCE_NEW;
if ((code = compute_lib_init(&compute_inst))) {
Expand All @@ -35,6 +36,7 @@ void uvdar::UVDARLedDetectFASTGPU::init() {
return;
}

std::cerr << "[UVDARDetectorFASTGPU]: Initializing compute program..." << std::endl;
// init compute program
char* formatted_src;
if (asprintf(&formatted_src, fastlike_shader_src, local_size_x, local_size_y, _threshold_, _threshold_diff_, _threshold_sun_, max_markers_count, max_sun_pts_count) < 0)
Expand All @@ -53,6 +55,7 @@ void uvdar::UVDARLedDetectFASTGPU::init() {

//compute_lib_program_print_resources(&compute_prog);

std::cerr << "[UVDARDetectorFASTGPU]: Initializing image2d objects..." << std::endl;
// init image2d objects
texture_in = COMPUTE_LIB_IMAGE2D_NEW("image_in", GL_TEXTURE0, image_size.width, image_size.height, GL_R8UI, GL_READ_ONLY, GL_CLAMP_TO_EDGE, GL_LINEAR, GL_RED_INTEGER, GL_UNSIGNED_BYTE);
if (compute_lib_image2d_init(&compute_prog, &texture_in, 0)) {
Expand All @@ -68,6 +71,7 @@ void uvdar::UVDARLedDetectFASTGPU::init() {
return;
}

std::cerr << "[UVDARDetectorFASTGPU]: Initializing SSBOs..." << std::endl;
// init SSBOs
markers_ssbo = COMPUTE_LIB_SSBO_NEW("markers_buffer", GL_UNSIGNED_INT, GL_DYNAMIC_DRAW);
if (compute_lib_ssbo_init(&compute_prog, &markers_ssbo, NULL, max_markers_count)) {
Expand All @@ -83,6 +87,7 @@ void uvdar::UVDARLedDetectFASTGPU::init() {
return;
}

std::cerr << "[UVDARDetectorFASTGPU]: Initializing atomic counter buffer objects..." << std::endl;
// init atomic counter buffer objects
markers_count_acbo = COMPUTE_LIB_ACBO_NEW("markers_count", GL_UNSIGNED_INT, GL_DYNAMIC_DRAW);
if (compute_lib_acbo_init(&compute_prog, &markers_count_acbo, NULL, 0)) {
Expand All @@ -97,10 +102,12 @@ void uvdar::UVDARLedDetectFASTGPU::init() {
return;
}

std::cerr << "[UVDARDetectorFASTGPU]: Running dummy clear of mask..." << std::endl;
// dummy clear of mask
uint32_t zero = 255;
compute_lib_image2d_reset(&compute_prog, &mask, &zero);

std::cerr << "[UVDARDetectorFASTGPU]: Initialized" << std::endl;
initialized_ = true;
}

Expand Down

0 comments on commit 8a30576

Please sign in to comment.