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

@ -17,14 +17,16 @@ 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?);
* (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<PFFFT_Setup *> 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?)
(sapi :: v :: GenericPtr - to be changed)
Temporary solution (not done): change the generated files to accept
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

View File

@ -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,28 +150,23 @@ int main(int argc, char* argv[]) {
sapi::StatusOr<PFFFT_Setup*> 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);