Sandbox not active error - resolved

This commit is contained in:
doinachiroiu 2020-08-17 11:21:56 +00:00
parent 3fb4d59545
commit 06bf6cdd34
2 changed files with 26 additions and 29 deletions

View File

@ -16,15 +16,17 @@ 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 - implemented pffft - implemented
* pffft benchmark bug: "Sandbox not active" * (Solved) 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 OK, pffft_transform generates error N > 64, status not OK
N > 64, status not OK Problem on initialising sapi::StatusOr<PFFFT_Setup *> s;
Problem on initialising sapi::StatusOr<PFFFT_Setup *> s; the memory that stays for s is not the same with the address passed
the memory that stays for s is not the same with the address passed in pffft_transform function.
in pffft_transform function. (sapi :: v :: GenericPtr - to be changed)
(sapi::v::GenericPtr to be changed?)
Temporary solution: change the generated files to accept
Temporary solution (not done): change the generated files to accept uintptr_t instead of PFFFT_Setup
uintptr_t instead of PFFFT_Setup
Solution: using "sapi :: v :: RemotePtr" instead of "sapi :: v :: GenericPtr"
to access the memory of object s

View File

@ -73,7 +73,7 @@ int main(int argc, char* argv[]) {
pffftSapiSandbox sandbox; pffftSapiSandbox sandbox;
sandbox.Init().IgnoreError(); sandbox.Init().IgnoreError();
printf("%s\n", sandbox.Init().ToString().c_str()); printf("Initialization: %s\n", sandbox.Init().ToString().c_str());
pffftApi api(&sandbox); pffftApi api(&sandbox);
@ -81,7 +81,7 @@ int main(int argc, char* argv[]) {
cplx = 0; cplx = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 23; i++) {
N = Nvalues[i]; N = Nvalues[i];
int Nfloat = N * (cplx ? 2 : 1); int Nfloat = N * (cplx ? 2 : 1);
@ -150,34 +150,29 @@ int main(int argc, char* argv[]) {
sapi::StatusOr<PFFFT_Setup*> s = sapi::StatusOr<PFFFT_Setup*> s =
api.pffft_new_setup(N, cplx ? PFFFT_COMPLEX : PFFFT_REAL); 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()) { if (s.ok()) {
sapi::v::GenericPtr s_reg(s.value()); sapi::v::RemotePtr s_reg(s.value());
t0 = uclock_sec(); t0 = uclock_sec();
for (iter = 0; iter < max_iter; ++iter) { for (iter = 0; iter < max_iter; ++iter) {
printf("%s\n", api.pffft_transform(&s_reg, X_.PtrBoth(), Z_.PtrBoth(), Y_.PtrBoth(),
api.pffft_transform(s_reg.PtrBoth(), X_.PtrBoth(), PFFFT_FORWARD)
Z_.PtrBoth(), Y_.PtrBoth(), PFFFT_FORWARD) .IgnoreError();
.ToString() api.pffft_transform(&s_reg, X_.PtrBoth(), Z_.PtrBoth(), Y_.PtrBoth(),
.c_str()); PFFFT_FORWARD)
printf("%s\n", .IgnoreError();
api.pffft_transform(s_reg.PtrBoth(), X_.PtrBoth(),
Z_.PtrBoth(), Y_.PtrBoth(), PFFFT_FORWARD)
.ToString()
.c_str());
} }
t1 = uclock_sec(); t1 = uclock_sec();
printf("%s\n", api.pffft_destroy_setup(&s_reg).IgnoreError();
api.pffft_destroy_setup(s_reg.PtrBoth()).ToString().c_str());
flops = flops =
(max_iter * 2) * ((cplx ? 5 : 2.5) * N * log((double)N) / M_LN2); (max_iter * 2) * ((cplx ? 5 : 2.5) * N * log((double)N) / M_LN2);
show_output("PFFFT", N, cplx, flops, t0, t1, max_iter); show_output("PFFFT", N, cplx, flops, t0, t1, max_iter);
} }
printf("\n\n"); printf("\n\n");
} }
} }