diff --git a/oss-internship-2020/pffft/README.txt b/oss-internship-2020/pffft/README.txt index 9c2556a..c7ac70b 100644 --- a/oss-internship-2020/pffft/README.txt +++ b/oss-internship-2020/pffft/README.txt @@ -16,15 +16,17 @@ CMake observations: Sandboxed main observations: * containing two testing parts (fft / pffft benchmarks) ! current stage: fft - works :) - 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 - Problem on initialising sapi::StatusOr s; - the memory that stays for s is not the same with the address passed - in pffft_transform function. - (sapi::v::GenericPtr to be changed?) - - Temporary solution (not done): change the generated files to accept - uintptr_t instead of PFFFT_Setup + pffft - implemented + * (Solved) pffft benchmark bug: "Sandbox not active" + N = 64, status OK, pffft_transform generates error + N > 64, status not OK + Problem on initialising sapi::StatusOr s; + the memory that stays for s is not the same with the address passed + in pffft_transform function. + (sapi :: v :: GenericPtr - to be changed) + + Temporary solution: change the generated files to accept + uintptr_t instead of PFFFT_Setup + + Solution: using "sapi :: v :: RemotePtr" instead of "sapi :: v :: GenericPtr" + to access the memory of object s diff --git a/oss-internship-2020/pffft/test_pffft_sandboxed.cc b/oss-internship-2020/pffft/test_pffft_sandboxed.cc index 8c91a77..e4b4602 100644 --- a/oss-internship-2020/pffft/test_pffft_sandboxed.cc +++ b/oss-internship-2020/pffft/test_pffft_sandboxed.cc @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) { pffftSapiSandbox sandbox; sandbox.Init().IgnoreError(); - printf("%s\n", sandbox.Init().ToString().c_str()); + printf("Initialization: %s\n", sandbox.Init().ToString().c_str()); pffftApi api(&sandbox); @@ -81,7 +81,7 @@ int main(int argc, char* argv[]) { cplx = 0; - for (i = 0; i < 5; i++) { + for (i = 0; i < 23; i++) { N = Nvalues[i]; int Nfloat = N * (cplx ? 2 : 1); @@ -150,34 +150,29 @@ int main(int argc, char* argv[]) { sapi::StatusOr s = api.pffft_new_setup(N, cplx ? PFFFT_COMPLEX : PFFFT_REAL); - printf("%s\n", s.status().ToString().c_str()); + printf("Setup status is: %s\n", s.status().ToString().c_str()); if (s.ok()) { - sapi::v::GenericPtr s_reg(s.value()); + sapi::v::RemotePtr 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()); + api.pffft_transform(&s_reg, X_.PtrBoth(), Z_.PtrBoth(), Y_.PtrBoth(), + PFFFT_FORWARD) + .IgnoreError(); + api.pffft_transform(&s_reg, X_.PtrBoth(), Z_.PtrBoth(), Y_.PtrBoth(), + PFFFT_FORWARD) + .IgnoreError(); } t1 = uclock_sec(); - printf("%s\n", - api.pffft_destroy_setup(s_reg.PtrBoth()).ToString().c_str()); + api.pffft_destroy_setup(&s_reg).IgnoreError(); 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"); + printf("\n\n"); } }