Added log printing for debug

This commit is contained in:
doinachiroiu 2020-08-20 08:58:30 +00:00
parent 94fcf82dd3
commit 257e87e076

View File

@ -1,4 +1,5 @@
#include <assert.h>
#include <glog/logging.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@ -61,6 +62,11 @@ void show_output(const char* name, int N, int cplx, float flops, float t0,
}
int main(int argc, char* argv[]) {
/*
* Initialize Google's logging library.
*/
google::InitGoogleLogging(argv[0]);
gflags::ParseCommandLineFlags(&argc, &argv, true);
/*
* Nvalues is a vector keeping the values by which iterates N, its value
@ -75,12 +81,12 @@ int main(int argc, char* argv[]) {
16384, 32768, 256 * 1024, 1024 * 1024, -1};
int i;
printf("initializing sandbox...\n");
VLOG(1) << "Initializing sandbox...\n";
pffftSapiSandbox sandbox;
sandbox.Init().IgnoreError();
printf("Initialization: %s\n", sandbox.Init().ToString().c_str());
VLOG(1) << "Initialization: " << sandbox.Init().ToString().c_str() << "\n";
pffftApi api(&sandbox);
@ -88,6 +94,7 @@ int main(int argc, char* argv[]) {
cplx = 0;
do {
for (i = 0; i < 23; i++) {
N = Nvalues[i];
@ -165,7 +172,7 @@ int main(int argc, char* argv[]) {
sapi::StatusOr<PFFFT_Setup*> s =
api.pffft_new_setup(N, cplx ? PFFFT_COMPLEX : PFFFT_REAL);
printf("Setup status is: %s\n", s.status().ToString().c_str());
VLOG(1) << "Setup status is: " << s.status().ToString().c_str() << "\n";
if (s.ok()) {
sapi::v::RemotePtr s_reg(s.value());
@ -187,9 +194,13 @@ int main(int argc, char* argv[]) {
(max_iter * 2) * ((cplx ? 5 : 2.5) * N * log((double)N) / M_LN2);
show_output("PFFFT", N, cplx, flops, t0, t1, max_iter);
}
printf("\n\n");
VLOG(1) << "N = " << N << " SUCCESSFULLY\n\n";
}
}
cplx = !cplx;
} while (cplx);
return 0;
}