2
* Copyright (c) 2003, 2006 Matteo Frigo
3
* Copyright (c) 2003, 2006 Massachusetts Institute of Technology
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
/* $Id: nop.c,v 1.17 2006-01-05 03:04:26 stevenj Exp $ */
23
/* plans for vrank -infty DFTs (nothing to do) */
27
static void apply(const plan *ego_, R *ri, R *ii, R *ro, R *io)
36
static int applicable(const solver *ego_, const problem *p_)
38
const problem_dft *p = (const problem_dft *) p_;
43
/* case 1 : -infty vector rank */
44
|| (!FINITE_RNK(p->vecsz->rnk))
46
/* case 2 : rank-0 in-place dft */
49
&& FINITE_RNK(p->vecsz->rnk)
51
&& X(tensor_inplace_strides)(p->vecsz)
55
static void print(const plan *ego, printer *p)
58
p->print(p, "(dft-nop)");
61
static plan *mkplan(const solver *ego, const problem *p, planner *plnr)
63
static const plan_adt padt = {
64
X(dft_solve), X(null_awake), print, X(plan_null_destroy)
70
if (!applicable(ego, p))
72
pln = MKPLAN_DFT(plan_dft, &padt, apply);
73
X(ops_zero)(&pln->super.ops);
78
static solver *mksolver(void)
80
static const solver_adt sadt = { PROBLEM_DFT, mkplan };
81
return MKSOLVER(solver, &sadt);
84
void X(dft_nop_register)(planner *p)
86
REGISTER_SOLVER(p, mksolver());