mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Testing pffft - elaborate output
This commit is contained in:
parent
2ab097f82f
commit
c39787ddc7
|
@ -16,4 +16,8 @@ CMake observations:
|
||||||
Sandboxed main observations:
|
Sandboxed main observations:
|
||||||
* containing two testing parts (fft / pffft benchmarks)
|
* containing two testing parts (fft / pffft benchmarks)
|
||||||
! current stage: fft - works :)
|
! 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
|
||||||
|
|
|
@ -60,12 +60,6 @@ void show_output(const char* name, int N, int cplx, float flops, float t0,
|
||||||
fflush(stdout);
|
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[]) {
|
int main(int argc, char* argv[]) {
|
||||||
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
int Nvalues[] = {64, 96, 128, 160, 192, 256,
|
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);
|
flops = (max_iter_ * 2) * ((cplx ? 5 : 2.5) * N * log((double)N) / M_LN2);
|
||||||
show_output("FFTPack", N, cplx, flops, t0, t1, max_iter_);
|
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;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user