Testing pffft - elaborate output

This commit is contained in:
doinachiroiu 2020-08-17 11:21:33 +00:00
parent 2ab097f82f
commit c39787ddc7
2 changed files with 40 additions and 7 deletions

View File

@ -16,4 +16,8 @@ CMake observations:
Sandboxed main observations:
* containing two testing parts (fft / pffft benchmarks)
! current stage: fft - works :)
pffft - not implemented
pffft - implemented
* pffft benchmark bug: "Sandbox not active"
=> loop in pffft_transform for N = 64 (why?);
N = 64, status OK, pffft_transform generates error
N > 64, status not OK

View File

@ -60,12 +60,6 @@ void show_output(const char* name, int N, int cplx, float flops, float t0,
fflush(stdout);
}
/*
For debug:
SAPI_VLOG_LEVEL=1 ./pffft_sandboxed --v=100
--sandbox2_danger_danger_permit_all_and_log my_aux_file
*/
int main(int argc, char* argv[]) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
int Nvalues[] = {64, 96, 128, 160, 192, 256,
@ -148,6 +142,41 @@ int main(int argc, char* argv[]) {
flops = (max_iter_ * 2) * ((cplx ? 5 : 2.5) * N * log((double)N) / M_LN2);
show_output("FFTPack", N, cplx, flops, t0, t1, max_iter_);
}
// PFFFT benchmark
{
sapi::StatusOr<PFFFT_Setup*> s =
api.pffft_new_setup(N, cplx ? PFFFT_COMPLEX : PFFFT_REAL);
printf("%s\n", s.status().ToString().c_str());
if (s.ok()) {
sapi::v::GenericPtr s_reg(s.value());
t0 = uclock_sec();
for (iter = 0; iter < max_iter; ++iter) {
printf("%s\n",
api.pffft_transform(s_reg.PtrBoth(), X_.PtrBoth(),
Z_.PtrBoth(), Y_.PtrBoth(), PFFFT_FORWARD)
.ToString()
.c_str());
printf("%s\n",
api.pffft_transform(s_reg.PtrBoth(), X_.PtrBoth(),
Z_.PtrBoth(), Y_.PtrBoth(), PFFFT_FORWARD)
.ToString()
.c_str());
}
t1 = uclock_sec();
printf("%s\n",
api.pffft_destroy_setup(s_reg.PtrBoth()).ToString().c_str());
flops =
(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");
}
}
return 0;