Skip to content

Commit

Permalink
Started new bench.c. I had to rename plan_destroy ->
Browse files Browse the repository at this point in the history
plan_destroy_internal to avoid conflicts with API
  • Loading branch information
matteo-frigo committed Jan 11, 2003
1 parent f315b29 commit 125c89f
Show file tree
Hide file tree
Showing 40 changed files with 233 additions and 130 deletions.
1 change: 0 additions & 1 deletion api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ void X(configure_planner)(planner *plnr);
void X(mapflags)(planner *, unsigned int);

apiplan *X(mkapiplan)(unsigned int flags, problem *prb);
void X(apiplan_destroy)(apiplan *p);

#endif /* __API_H__ */
6 changes: 3 additions & 3 deletions api/apiplan.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ apiplan *X(mkapiplan)(unsigned int flags, problem *prb)
/* blessing protocol */
plnr->planner_flags |= BLESSING;
pln0 = plnr->adt->mkplan(plnr, prb);
X(plan_destroy)(pln0);
X(plan_destroy_internal)(pln0);
} else {
X(problem_destroy)(p->prb);
}
Expand All @@ -56,11 +56,11 @@ apiplan *X(mkapiplan)(unsigned int flags, problem *prb)
return p;
}

void X(apiplan_destroy)(apiplan *p)
void X(plan_destroy)(X(plan) p)
{
if (p) {
AWAKE(p->pln, 0);
X(plan_destroy)(p->pln);
X(plan_destroy_internal)(p->pln);
X(problem_destroy)(p->prb);
X(free)(p);
}
Expand Down
4 changes: 3 additions & 1 deletion api/fftw3.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

/* header file for fftw3 */
/* $Id: fftw3.h,v 1.5 2003-01-11 05:52:04 stevenj Exp $ */
/* $Id: fftw3.h,v 1.6 2003-01-11 14:17:34 athena Exp $ */

#ifndef FFTW3_H
#define FFTW3_H
Expand Down Expand Up @@ -55,6 +55,8 @@ void X(execute)(X(plan) p); \
\
X(plan) X(plan_dft_1d)(unsigned int n, C *in, C *out, int sign, \
unsigned int flags); \
\
void X(plan_destroy)(X(plan) p);


/* end of FFTW_DEFINE_API macro */
Expand Down
14 changes: 7 additions & 7 deletions dft/buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: buffered.c,v 1.40 2002-09-25 01:27:49 athena Exp $ */
/* $Id: buffered.c,v 1.41 2003-01-11 14:17:34 athena Exp $ */

#include "dft.h"

Expand Down Expand Up @@ -95,9 +95,9 @@ static void awake(plan *ego_, int flg)
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cldrest);
X(plan_destroy)(ego->cldcpy);
X(plan_destroy)(ego->cld);
X(plan_destroy_internal)(ego->cldrest);
X(plan_destroy_internal)(ego->cldcpy);
X(plan_destroy_internal)(ego->cld);
}

static void print(plan *ego_, printer *p)
Expand Down Expand Up @@ -279,9 +279,9 @@ static plan *mkplan(const solver *ego_, const problem *p_, planner *plnr)

nada:
X(free0)(bufs);
X(plan_destroy)(cldrest);
X(plan_destroy)(cldcpy);
X(plan_destroy)(cld);
X(plan_destroy_internal)(cldrest);
X(plan_destroy_internal)(cldcpy);
X(plan_destroy_internal)(cld);
return (plan *) 0;
}

Expand Down
4 changes: 2 additions & 2 deletions dft/ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: ct.c,v 1.27 2002-09-22 16:25:20 athena Exp $ */
/* $Id: ct.c,v 1.28 2003-01-11 14:17:34 athena Exp $ */

/* generic Cooley-Tukey routines */
#include "dft.h"
Expand All @@ -28,7 +28,7 @@ static void destroy(plan *ego_)
{
plan_ct *ego = (plan_ct *) ego_;

X(plan_destroy)(ego->cld);
X(plan_destroy_internal)(ego->cld);
X(stride_destroy)(ego->ios);
X(stride_destroy)(ego->vs);
}
Expand Down
4 changes: 2 additions & 2 deletions dft/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static void awake(plan *ego_, int flg)
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cld);
X(plan_destroy_internal)(ego->cld);
}

static void print(plan *ego_, printer *p)
Expand Down Expand Up @@ -183,7 +183,7 @@ static plan *mkplan(const solver *ego, const problem *p_, planner *plnr)
return &(pln->super.super);

nada:
X(plan_destroy)(cld);
X(plan_destroy_internal)(cld);
X(free0)(pln);
return (plan *) 0;
}
Expand Down
10 changes: 5 additions & 5 deletions dft/indirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: indirect.c,v 1.31 2002-09-22 20:03:30 athena Exp $ */
/* $Id: indirect.c,v 1.32 2003-01-11 14:17:34 athena Exp $ */


/* solvers/plans for vectors of small DFT's that cannot be done
Expand Down Expand Up @@ -109,8 +109,8 @@ static const ndrct_adt adt_after =
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cld);
X(plan_destroy)(ego->cldcpy);
X(plan_destroy_internal)(ego->cld);
X(plan_destroy_internal)(ego->cldcpy);
}

static void awake(plan *ego_, int flg)
Expand Down Expand Up @@ -210,8 +210,8 @@ static plan *mkplan(const solver *ego_, const problem *p_, planner *plnr)
return &(pln->super.super);

nada:
X(plan_destroy)(cld);
X(plan_destroy)(cldcpy);
X(plan_destroy_internal)(cld);
X(plan_destroy_internal)(cldcpy);
return (plan *)0;
}

Expand Down
16 changes: 8 additions & 8 deletions dft/rader.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ static void awake_dit(plan *ego_, int flg)
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cld_omega);
X(plan_destroy)(ego->cld2);
X(plan_destroy)(ego->cld1);
X(plan_destroy_internal)(ego->cld_omega);
X(plan_destroy_internal)(ego->cld2);
X(plan_destroy_internal)(ego->cld1);
}

static void destroy_dit(plan *ego_)
{
P_dit *ego = (P_dit *) ego_;
X(plan_destroy)(ego->cld);
X(plan_destroy_internal)(ego->cld);
destroy(ego_);
}

Expand Down Expand Up @@ -385,9 +385,9 @@ static int mkP(P *pln, uint n, int is, int os, R *ro, R *io,

nada:
X(free0)(buf);
X(plan_destroy)(cld_omega);
X(plan_destroy)(cld2);
X(plan_destroy)(cld1);
X(plan_destroy_internal)(cld_omega);
X(plan_destroy_internal)(cld2);
X(plan_destroy_internal)(cld1);
return 0;
}

Expand Down Expand Up @@ -462,7 +462,7 @@ static plan *mkplan_dit(const solver *ego, const problem *p_, planner *plnr)
return &(pln->super.super.super);

nada:
X(plan_destroy)(cld);
X(plan_destroy_internal)(cld);
X(free0)(pln);
return (plan *) 0;
}
Expand Down
10 changes: 5 additions & 5 deletions dft/rank-geq2.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: rank-geq2.c,v 1.31 2003-01-07 20:00:14 stevenj Exp $ */
/* $Id: rank-geq2.c,v 1.32 2003-01-11 14:17:34 athena Exp $ */

/* plans for DFT of rank >= 2 (multidimensional) */

Expand Down Expand Up @@ -63,8 +63,8 @@ static void awake(plan *ego_, int flg)
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cld2);
X(plan_destroy)(ego->cld1);
X(plan_destroy_internal)(ego->cld2);
X(plan_destroy_internal)(ego->cld1);
}

static void print(plan *ego_, printer *p)
Expand Down Expand Up @@ -183,8 +183,8 @@ static plan *mkplan(const solver *ego_, const problem *p_, planner *plnr)
return &(pln->super.super);

nada:
X(plan_destroy)(cld2);
X(plan_destroy)(cld1);
X(plan_destroy_internal)(cld2);
X(plan_destroy_internal)(cld1);
X(tensor_destroy4)(sz1, sz2, vecszi, sz2i);
return (plan *) 0;
}
Expand Down
4 changes: 2 additions & 2 deletions dft/vrank-geq1.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: vrank-geq1.c,v 1.27 2003-01-07 10:09:42 athena Exp $ */
/* $Id: vrank-geq1.c,v 1.28 2003-01-11 14:17:34 athena Exp $ */


/* Plans for handling vector transform loops. These are *just* the
Expand Down Expand Up @@ -74,7 +74,7 @@ static void awake(plan *ego_, int flg)
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cld);
X(plan_destroy_internal)(ego->cld);
}

static void print(plan *ego_, printer *p)
Expand Down
4 changes: 2 additions & 2 deletions kernel/ifftw.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: ifftw.h,v 1.166 2003-01-11 07:10:50 stevenj Exp $ */
/* $Id: ifftw.h,v 1.167 2003-01-11 14:17:34 athena Exp $ */

/* FFTW internal header file */
#ifndef __IFFTW_H__
Expand Down Expand Up @@ -377,7 +377,7 @@ struct plan_s {

plan *X(mkplan)(size_t size, const plan_adt *adt);
void X(plan_use)(plan *ego);
void X(plan_destroy)(plan *ego);
void X(plan_destroy_internal)(plan *ego);
void X(plan_awake)(plan *ego, int flag);
#define AWAKE(plan, flag) X(plan_awake)(plan, flag)
void X(plan_null_destroy)(plan *ego);
Expand Down
4 changes: 2 additions & 2 deletions kernel/plan.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: plan.c,v 1.16 2002-09-22 20:03:30 athena Exp $ */
/* $Id: plan.c,v 1.17 2003-01-11 14:17:34 athena Exp $ */

#include "ifftw.h"

Expand Down Expand Up @@ -50,7 +50,7 @@ void X(plan_use)(plan *ego)
/*
* destroy a plan
*/
void X(plan_destroy)(plan *ego)
void X(plan_destroy_internal)(plan *ego)
{
if (ego && --ego->refcnt == 0) {
if (ego->awake_refcnt > 0)
Expand Down
6 changes: 3 additions & 3 deletions kernel/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: planner.c,v 1.121 2003-01-05 07:37:31 stevenj Exp $ */
/* $Id: planner.c,v 1.122 2003-01-11 14:17:34 athena Exp $ */
#include "ifftw.h"
#include <string.h>

Expand Down Expand Up @@ -360,11 +360,11 @@ static plan *mkplan0(planner *ego, problem *p, slvdesc **descp)
}
evaluate_plan(ego, pln, p);
if (pln->pcost < best->pcost) {
X(plan_destroy)(best);
X(plan_destroy_internal)(best);
best = pln;
*descp = sp;
} else {
X(plan_destroy)(pln);
X(plan_destroy_internal)(pln);
}
} else {
best = pln;
Expand Down
5 changes: 4 additions & 1 deletion libbench/bench-user.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: bench-user.h,v 1.9 2002-09-14 03:07:39 stevenj Exp $ */
/* $Id: bench-user.h,v 1.10 2003-01-11 14:17:34 athena Exp $ */
#ifndef __BENCH_USER_H__
#define __BENCH_USER_H__

Expand Down Expand Up @@ -79,6 +79,9 @@ struct problem {
void *userinfo; /* user can store whatever */
};

extern void timer_start(void);
extern double timer_stop(void);

extern int can_do(struct problem *p);
extern void setup(struct problem *p);
extern void doit(int iter, struct problem *p);
Expand Down
4 changes: 1 addition & 3 deletions libbench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: bench.h,v 1.4 2002-09-14 03:07:39 stevenj Exp $ */
/* $Id: bench.h,v 1.5 2003-01-11 14:17:34 athena Exp $ */

/* benchmark program definitions */
#include "config.h"
Expand All @@ -28,8 +28,6 @@ extern double time_min;
extern int time_repeat;

extern void timer_init(double tmin, int repeat);
extern void timer_start(void);
extern double timer_stop(void);

/* report functions */
extern void (*report)(const struct problem *p, double *t, int st);
Expand Down
14 changes: 7 additions & 7 deletions rdft/buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

/* $Id: buffered.c,v 1.22 2003-01-08 21:46:24 stevenj Exp $ */
/* $Id: buffered.c,v 1.23 2003-01-11 14:17:34 athena Exp $ */

#include "rdft.h"

Expand Down Expand Up @@ -88,9 +88,9 @@ static void awake(plan *ego_, int flg)
static void destroy(plan *ego_)
{
P *ego = (P *) ego_;
X(plan_destroy)(ego->cldrest);
X(plan_destroy)(ego->cldcpy);
X(plan_destroy)(ego->cld);
X(plan_destroy_internal)(ego->cldrest);
X(plan_destroy_internal)(ego->cldcpy);
X(plan_destroy_internal)(ego->cld);
}

static void print(plan *ego_, printer *p)
Expand Down Expand Up @@ -264,9 +264,9 @@ static plan *mkplan(const solver *ego_, const problem *p_, planner *plnr)

nada:
X(free0)(bufs);
X(plan_destroy)(cldrest);
X(plan_destroy)(cldcpy);
X(plan_destroy)(cld);
X(plan_destroy_internal)(cldrest);
X(plan_destroy_internal)(cldcpy);
X(plan_destroy_internal)(cld);
return (plan *) 0;
}

Expand Down
Loading

0 comments on commit 125c89f

Please sign in to comment.